in reply to shouldn't this work?
my $output; while( my $line = <DATA> ) { # get rid of line terminator: chomp $line; next unless $line; # Get rid of line numbers: $line =~ s/^N[0-9]{2}\ //; # Replace * and the beginning of the line with !: $line =~ s/^\*/!/ and print $line and next; # Keep any numbers prefixed with X,Y or Z.: $line =~ s/(X|Y|Z)([0-9.-]+)/ $2/g; # Throw the rest away: $line =~ s/[A-Z][0-9.+-]+//g; print $line; } ...
|
|---|