in reply to How to extract the 4 number in the filename?
UPDATED: Having been censured for answering an easy question, I'll try going all Perlmonks.
my $FOUR_DIGIT_CAPTURE = qr/ ( # left as an exercise ) /x; while (<DATA>) { if (my ($four_digit_num) = /$FOUR_DIGIT_CAPTURE/) { print # left as an exercise } else { # left as an exercise } } __DATA__ j9999120.125 Be sure to include lots of interesting test cases.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to extract the 4 number in the filename?
by padawan_linuxero (Scribe) on Apr 11, 2008 at 22:31 UTC | |
|
Re^2: How to extract the 4 number in the filename?
by apl (Monsignor) on Apr 11, 2008 at 20:22 UTC |