summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-09-17 22:40:36 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-09-17 22:40:36 +0200
commitaf64d73b674c913080c9674a11640099a7501210 (patch)
tree599f35cf22d6f12e7f1c7740f64ad99d7e44203e
parent1def4dfac5782f8eda247ab897e7c362a5d3b8dd (diff)
Minor code cleanup
-rwxr-xr-xbin/tibtoa13
1 files changed, 6 insertions, 7 deletions
diff --git a/bin/tibtoa b/bin/tibtoa
index 88f6bb5..9c18d7a 100755
--- a/bin/tibtoa
+++ b/bin/tibtoa
@@ -26,7 +26,6 @@ my ($header, $footer);
my ($char, $char2);
my $out;
my $cache;
-my $hex;
my ($indent, $rindent) = (0,0);
my %opts;
my ($program, $length, $offset);
@@ -840,11 +839,11 @@ sub header_datestr($) {
getopts('ih', \%opts);
-open(PRGM, '<', shift) or die;
-binmode(PRGM);
-read(PRGM, $header, $headerlength);
-$program = <PRGM>;
-close(PRGM);
+open(my $input, '<', shift) or die;
+binmode($input);
+read($input, $header, $headerlength);
+$program = <$input>;
+close($input);
# The last two bytes don't contain program code
$footer = substr($program, -$footerlength, $footerlength, '');
@@ -868,7 +867,7 @@ if ($opts{h}) {
print_header('Name :', $header{name});
print_header('Length w/o header:', $header{size}->{full});
if ($header{type} eq 'matrix') {
- print_header('Matrix dimensions:', join('x', @{$header{size}}{'rows','cols'}));
+ print_header('Matrix dimensions:', join('x', @{$header{size}}{'rows', 'cols'}));
} elsif ($header{type} eq 'list') {
print_header('List length :', $header{size}->{items});
} elsif ($header{type} eq 'string') {