diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2011-10-17 21:55:45 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2011-10-17 21:55:45 +0000 |
commit | da930e48ad275f371c368da9d40caca253055854 (patch) | |
tree | 232fd2d1426d5698ec810c8d9b4dfa955e8355b1 /utils | |
parent | 6959a30b26c48ab985085cc5f5d098d0f6c33374 (diff) | |
download | netsurf-da930e48ad275f371c368da9d40caca253055854.tar.gz netsurf-da930e48ad275f371c368da9d40caca253055854.tar.bz2 |
Use local variables instead of global filehandles
svn path=/trunk/netsurf/; revision=13068
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/svn-testament.pl | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/utils/svn-testament.pl b/utils/svn-testament.pl index ba99124d4..7257f58fc 100755 --- a/utils/svn-testament.pl +++ b/utils/svn-testament.pl @@ -30,9 +30,9 @@ sub gather_output { my $tmpfile = File::Temp::tmpnam(); local $/ = undef(); system("$cmd > $tmpfile"); - open CMDH, "<", $tmpfile; - my $ret = <CMDH>; - close CMDH; + open(my $CMDH, "<", $tmpfile); + my $ret = <$CMDH>; + close($CMDH); unlink($tmpfile); return $ret; } @@ -137,22 +137,22 @@ use Digest::MD5 qw(md5_hex); my $oldcsum = ""; if ( -e $targetfile ) { - open OLDVALUES, "<", $targetfile; - foreach my $line (readline(OLDVALUES)) { + open(my $OLDVALUES, "<", $targetfile); + foreach my $line (readline($OLDVALUES)) { if ($line =~ /MD5:([0-9a-f]+)/) { $oldcsum = $1; } } - close OLDVALUES; + close($OLDVALUES); } my $newcsum = md5_hex($testament); if ($oldcsum ne $newcsum) { print "TESTMENT: $targetfile\n"; - open NEWVALUES, ">", $targetfile or die "$!"; - print NEWVALUES "/* ", $targetfile,"\n"; - print NEWVALUES <<'EOS'; + open(my $NEWVALUES, ">", $targetfile) or die "$!"; + print $NEWVALUES "/* ", $targetfile,"\n"; + print $NEWVALUES <<'EOS'; * * Revision testament. * @@ -163,14 +163,14 @@ if ($oldcsum ne $newcsum) { EOS - print NEWVALUES "#ifndef NETSURF_REVISION_TESTAMENT\n"; - print NEWVALUES "#define NETSURF_REVISION_TESTAMENT \"$newcsum\"\n\n"; - print NEWVALUES "/* Revision testament checksum:\n"; - print NEWVALUES " * MD5:", $newcsum,"\n */\n\n"; - print NEWVALUES "/* Revision testament: */\n"; - print NEWVALUES $testament; - print NEWVALUES "\n#endif\n"; - close NEWVALUES; + print $NEWVALUES "#ifndef NETSURF_REVISION_TESTAMENT\n"; + print $NEWVALUES "#define NETSURF_REVISION_TESTAMENT \"$newcsum\"\n\n"; + print $NEWVALUES "/* Revision testament checksum:\n"; + print $NEWVALUES " * MD5:", $newcsum,"\n */\n\n"; + print $NEWVALUES "/* Revision testament: */\n"; + print $NEWVALUES $testament; + print $NEWVALUES "\n#endif\n"; + close($NEWVALUES); foreach my $unwanted (@ARGV) { next unless(-e $unwanted); print "TESTAMENT: Removing $unwanted\n"; |