diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-09-17 22:40:36 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-09-17 22:40:36 +0200 |
commit | af64d73b674c913080c9674a11640099a7501210 (patch) | |
tree | 599f35cf22d6f12e7f1c7740f64ad99d7e44203e | |
parent | 1def4dfac5782f8eda247ab897e7c362a5d3b8dd (diff) |
Minor code cleanup
-rwxr-xr-x | bin/tibtoa | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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') { |