On Tue, 11 Mar 2003 08:05:05 -0800, Richard Cook wrote: >It's also useful to remember that this works for array building too: > >my (@list) = m/(your string here)/g; > >so that you can then test for if (@list) ...
Cute.
Do note that the /g modifier works differently in list context, as here,
than in scalar context.
I usually do this this way:
if(my ($name) = m/(your string here)/) {
... # success. $name is set.
}
--
Bart.
