http://qs321.pair.com?node_id=1054193


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)