in reply to Re: all matches
in thread all matches

To clarify, (?{}) constructs can be used without the use re 'eval' pragma, but only if the regex contains no elements interpolated from variables. Perhaps an example is called for:
#fine /a (.*) a(.)*(?{push @substrings, $^N}) (?!)/ #not fine: we get part of the regex body from a variable /$regex(?{push @substrings, $^N}) (?!)/ ^^^^^^ this variable interpolation requires that you use re 'eval'
Type perldoc re at your command prompt for more info.



Code is (almost) always untested.
http://www.justicepoetic.net/

Replies are listed 'Best First'.
Re: Re: Re: all matches
by oz (Novice) on Mar 25, 2004 at 06:58 UTC
    Thanks for the replies:)I checked the perldoc re and and it solved the eval problem but still although there is correct number of match in the array they are all undefined. I would appreciate any help? thanks