in reply to expressions as constants

This is probably neither the most graceful nor most efficient way to do it, but all you need to do is store your expression in a variable and eval the variable whenever you want to use it. For example:

#!/usr/bin/perl # my $expr = '$a + $b'; my $a = 4; my $b = 3; print eval $expr, "\n"; $a = 6; print eval $expr, "\n"; if( (eval $expr) == 9 ) { print "eval \$expr = 9\n"; }
output:

247.~/perl/tmp > a.pl 7 9 eval $expr = 9
hope this helps,

davidj