Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- PERL 4.0 Reference Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

     eval(EXPR)

     eval EXPR

             EXPR is parsed and executed as if it were  a  little
             perl  program.  It is executed in the context of the
             current perl program, so that any variable settings,
             subroutine  or format definitions remain afterwards.
             The value returned is the value of the last  expres-
             sion  evaluated, just as with subroutines.  If there
             is a syntax error or runtime error, or a die  state-
             ment  is executed, an undefined value is returned by
             eval, and $@ is set to the error message.  If  there
             was  no error, $@ is guaranteed to be a null string.
             If EXPR is omitted, evaluates $_.  The  final  semi-
             colon, if any, may be omitted from the expression.

             Note that, since eval traps otherwise-fatal  errors,
             it  is  useful  for determining whether a particular
             feature (such as dbmopen or symlink) is implemented.
             It  is  also  Perl's  exception  trapping mechanism,
             where the die operator is used to raise exceptions.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson