On Sun, Apr 29, 2012 at 11:10:33AM -0500, Lawrence Statton wrote: > From perlretut, I quote: > > In list context, "//g" returns a list of matched groupings, > or if there are no groupings, a list of matches to > the whole regexp. So if we wanted just the words, we could use > > @word = ($x =~ /(\w+)/g); # matches, > # $word[0] = 'cat' > # $word[1] = 'dog' > # $word[2] = 'house' > > (Note that the docs (at least on my copy of perl) have a typo ... it > says @words, not @word.)
This has now been fixed by http://perl5.git.perl.org/perl.git/commitdiff/5a0c7e9d45ff6da450098635b233527990112d8a?hp=68cd360812f9eaa2d34c45c501e2fef87c44ccde and will be in the upcoming 5.16.0 release. Thanks for mentioning it. -- Paul Johnson - p...@pjcj.net http://www.pjcj.net -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/