Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Extending Perl::PIE - how to have Perl snippets executed ?

by spazm (Monk)
on Jul 13, 2009 at 18:02 UTC ( [id://779695]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Extending Perl::PIE - how to have Perl snippets executed ?
in thread Extending Perl::PIE - how to have Perl snippets executed ?

Rob,

Thanks for the update. I don't have time to look at it currently, but a perl rules engine sounds interesting.

It looks like you need something to interpolate your string. So, something like changing your print routine to include an eval of the string?

I don't think the code below works, but may prove helpful? You may also find yourself doing a search on the returned string to fill in values... blech.

$string =~ s/\$(\w+)/ ${$1} /xeg;
orig:
print " ----------------- " . $ref->{attribute} . "\n"
new:
my $string = $ref->{attribute}; my $output = eval $string; if($@){ die "problem with eval: $@"; } print " ----------------- $output\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 17:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found