Definitely more perlish, but why waste cpu clicks chomping lines that might be rejected? I'd move the chomp line to be immediately after the next unless ... line. I'd perhaps even question whether chomp was necessary here as the dot in the regex will not match the line terminator.
J:\johngg>i:\cygwin\bin\hexdump.exe -C test.txt 00000000 61 61 61 61 61 31 32 33 0d 0a |aaaaa123. +.| 0000000a J:\johngg>perl -nle "next unless /^a+(.*)/; print qq{>$1<};" test.txt >123<
I hope this is of interest.
Cheers,
JohnGG
In reply to Re^4: Pulling lines from file, noob style
by johngg
in thread Pulling lines from file, noob style
by jperkins
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |