Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Re: Re: substitution interpolation?

by h0mee (Acolyte)
on May 31, 2001 at 06:43 UTC ( [id://84438]=note: print w/replies, xml ) Need Help??

in reply to Re: Re: substitution interpolation?
in thread substitution interpolation?

Thanks for pointing out my totally clueless use of qr// (was going on the advice of someone on IRC when I went down that path, instead of RTFM'ing). What I don't understand is- why does the evaling the entire expression work? Does it force interpolation of $lhs and $rhs before the expression is evaluated? In experiments,
$_ = $var; eval "s/$lhs/$rhs/";
works, but:
eval "$var =~ /$lhs/$rhs/;";
doesn't work- what am I missing?

Replies are listed 'Best First'.
Re: Re: Re: Re: substitution interpolation?
by lestrrat (Deacon) on May 31, 2001 at 06:47 UTC

    try this:

    eval "\$var =~ s/$lhs/$rhs/";

    update:fixed typo

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-18 23:12 GMT
Find Nodes?
    Voting Booth?

    No recent polls found