die 'insufficient arguments' unless @ARGV == 1; open(IN, $ARGV[0]) or die "unable to open '$ARGV[0]'"; while (my $line = ) { my $prefix = sprintf '%4d', $.; $line =~ s/$line/$prefix: $line/; print $line; } close IN; #### $ perl test.pl test.pl 1: die 'insufficient arguments' unless @ARGV == 1; open(IN, $ARGV[0]) or die "unable to open '$ARGV[0]'"; while (my $line = ) { my $prefix = sprintf '%4d', $.; $line =~ s/$line/$prefix: $line/; print $line; 7: } 8: close IN; $ #### $ perl test.pl test.pl 1: use strict; 2: die 'insufficient arguments' unless @ARGV == 1; open(IN, $ARGV[0]) or die "unable to open '$ARGV[0]'"; while (my $line = ) { my $prefix = sprintf '%4d', $.; $line =~ s/$line/$prefix: $line/; print $line; 8: } 9: close IN; $