use strict; use warnings; my $restOfLine = q{one fish two fish red fish blue fish}; my @words = $restOfLine =~ m{(\S+)\s+fish}g; print qq{$_\n} for @words;
which produces
one two red blue
I hope this is of use.
Cheers,
JohnGG
In reply to Re: match last element instead of first??
by johngg
in thread match last element instead of first??
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |