summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorbw12017-04-02 20:30:12 +0200
committerbw12017-04-02 20:30:12 +0200
commit6096d0489e04cad7ce3fedc8fe596a3f18ca7935 (patch)
treec448992dd5812979ce8f7d41e7b6055919891c86 /scripts
parent86cda6995891ea3102e171b92c9ac1014647c1fa (diff)
downloadscripts.irssi.org-6096d0489e04cad7ce3fedc8fe596a3f18ca7935.tar.bz2
[sysinfoplus][crit] rewrite open; move strict
Diffstat (limited to 'scripts')
-rw-r--r--scripts/sysinfoplus.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/sysinfoplus.pl b/scripts/sysinfoplus.pl
index cc82d0d..fc0cff0 100644
--- a/scripts/sysinfoplus.pl
+++ b/scripts/sysinfoplus.pl
@@ -16,8 +16,10 @@
# -Total amount of memory counts (not the used amount, as before)
# Changelog 2.10 -> 2.20: memory/swap info is displayed now (it was broken previously) and code is properly indented
+use strict;
+use vars qw/$VERSION %IRSSI/;
-$VERSION = "2.20";
+$VERSION = "2.21";
%IRSSI = (
authors => "Juerd, Tronic",
contact => "trn\@iki.fi",
@@ -25,7 +27,7 @@ $VERSION = "2.20";
description => "Linux system information (with vPenis and other stuff)",
license => "Public Domain",
url => "http://juerd.nl/irssi/",
- changed => "Mon Nov 04 15:17:30 EET 2002"
+ changed => "2017-04-02"
);
BEGIN{
@@ -37,7 +39,6 @@ BEGIN{
$console = !!$@;
}
-use strict;
# Tronic has no time for maintaining this and Juerd hates braces, so it might be better
# not to expect any new versions ...
@@ -51,7 +52,7 @@ sub sysinfo{
$ret = "Host '@uname[1]', running @uname[0] @uname[2] - ";
- open FOO, '/proc/cpuinfo';
+ open FOO,'<', '/proc/cpuinfo';
while (<FOO>){
/^processor\s*:\s*(\d+)/ ? $ret .= "Cpu$1: "
: /^model name\s*:\s*(\w+[ A-Za-z]*)/ ? do { my $t = $1; $t =~ s/\s+$//; $ret .= "$t " }
@@ -60,7 +61,7 @@ sub sysinfo{
}
close FOO;
$ret =~ s/( ?)$/;$1/;
- open FOO, '/proc/pci';
+ open FOO,'<', '/proc/pci';
while (<FOO>){
/^\s*(?:multimedia )?(.*?)( storage| compatible)? controller/i and push @pci, $1;
}