Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: all matches

by jweed (Chaplain)
on Mar 25, 2004 at 05:51 UTC ( [id://339650]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://339650]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-25 22:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found