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";