http://www.perlmonks.org?node_id=848067


in reply to perl eval

Would your code work without the eval?

Hint:

sub egal ()

does not do what you want, or, maybe in this case, actually does what you intended at one time.

Consider this program:

#!perl -w use strict; my $param = shift; print "About to run: [$param]\n"; my @res = eval($param); print $@ if $@; sub egal () { print "Got arguments [@_]\n"; }

Also, consider running your programs using perl -w. That way, Perl will tell you about things that might not be what you think them to be. Especially, there are no true or false keywords in Perl.