in reply to Re^4: Capturing regex from map
in thread Capturing regex from map
Well the OP had only one grouping and no /g modifier, such that it does the same thing.
DB<120> @a = map { /(\w*a\w*)/;$1||() } `ls` => ( "babel", "emacs1000", "lanx", "lanx", "seahorse", "man", "Tracker", "virtual", ) DB<121> @a = map { /(\w*a\w*)/ } `ls` => ( "babel", "emacs1000", "lanx", "lanx", "seahorse", "man", "Tracker", "virtual", )
update
FWIW: As already posted my approach to clarify whats happening is
map { my @matches = /.../ ; @matches } LIST or even map { my @matches = /.../ } LIST
Cheers Rolf
( addicted to the Perl Programming Language)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Capturing regex from map
by BrowserUk (Patriarch) on Sep 15, 2013 at 21:13 UTC | |
by Anonymous Monk on Sep 16, 2013 at 01:17 UTC | |
by BrowserUk (Patriarch) on Sep 16, 2013 at 01:38 UTC | |
by Anonymous Monk on Sep 16, 2013 at 06:06 UTC |
In Section
Seekers of Perl Wisdom