in reply to Re: How to use eval?
in thread How to use eval?

$ more eval #!/usr/bin/perl $code = 'if($a>$b){ $result =1} '; $a =1; $b = 0; $result =0; eval $code; print "eval error\n" if($@); print $result; $ eval $ perl -v This is perl, v5.8.2 built for sun4-solaris Copyright 1987-2003, Larry Wall
You can see what's happened on my computer,there are nothing .
Which perl version do you use ?Maybe it is a bug?
thanks!

Replies are listed 'Best First'.
Re: Re: Re: How to use eval?
by bmann (Priest) on Apr 09, 2004 at 07:51 UTC
    eval is a shell builtin. Just rename your script or run it with perl eval.
      ./eval would probably work, too (or would at least complain if he forgot to make it executable...)

        ah, I sometimes fall through this trap, when I've made an executable named test. But till I've removed . from the PATH, I never get caught like this, as I always have to type ./whatever.

        Update: s'ed "test" to "trap". Was too tired when I posted it.