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

Re: "eval" variable in non-perl statment?

by c-era (Curate)
on Mar 29, 2001 at 00:32 UTC ( [id://67935]=note: print w/replies, xml ) Need Help??


in reply to "eval" variable in non-perl statment?

You should used a module (like the template toolkit), but for something really simple (or for fun), you can use a regex: $input =~ s/(\$.*?) /eval ("\$tmp = $1;"); "$tmp "/e; Note, this code is easy to break, you can't have any other $, and you need to be careful about line breaks.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-09-11 00:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (10 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.