From af64d73b674c913080c9674a11640099a7501210 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 17 Sep 2009 22:40:36 +0200 Subject: Minor code cleanup --- bin/tibtoa | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'bin') 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 = ; -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') { -- cgit v1.2.3