Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^3: Character class in an array

by Aristotle (Chancellor)
on Sep 17, 2002 at 22:08 UTC ( [id://198668]=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Character class in an array
in thread Character class in an array

But will fail if the regex is used multiple times with varying array contents.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re^3: Character class in an array
by Fastolfe (Vicar) on Sep 21, 2002 at 18:23 UTC
    I was just extending the original poster's qr/// suggestion. If you interpolate a variable in a 'qr' string, it "stays" interpolated and will not change if the value of the original variable changes with it, unless you re-create the string for every iteration. Obviously, if you're going to want to use qr/// or the /o flag on a regex, you are doing so because you wish Perl to compile the regular expression once (at least within the lexical scope of the qr/// string).
      True enough - what I'm saying is you don't have that option to begin with when using /o.

      Makeshifts last the longest.

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-14 18:19 GMT
Find Nodes?
    Voting Booth?

    No recent polls found