Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Putting the stringified Regexp object into code

by AnomalousMonk (Canon)
on Nov 06, 2012 at 21:39 UTC ( #1002580=note: print w/replies, xml ) Need Help??

in reply to Putting the stringified Regexp object into code

The deferred interpolation of scalars in a regex can still be depended on if the deference of all the various interpolations involved can be synched up properly.

(However, I share the suspicions of others about this approach to what seems like a templating problem.)

>perl -wMstrict -le "my $rx = qr{ foo/bar }xms; print $rx; ;; my $str = 'xx foo/bar yy'; eval qq{ print q{match} if \$str =~ \$rx; my \$ry = q{$rx}; print qq{captured '\$1'} if \$str =~ m/(\$ry)/; }; $@ and die qq{eval err: $@}; " (?^msx: foo/bar ) match captured 'foo/bar'

Update: Slightly altered example code to more closely match my previous post.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002580]
[karlgoethebier]: marioroy: If you provide an email address i'll send you the full script of TNOG...
[karlgoethebier]: marioroy: Checkout also "Linear Expressions" by the same author...
[marioroy]: thanks karlgoethebier.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (15)
As of 2017-03-24 10:18 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (298 votes). Check out past polls.