Home >> perlfunctions >>
evaleval() has two forms.
The first takes a string, and treats it as Perl
code. It compiles and executes it, returning whatever value is
appropriate. If there is a fatal error, it sets the $@ variable.
The other form is eval { CODE }. This executes a block of code in a
fail-safe environment. If there are any fatal errors, the $@ is set, and
the block is exited. A common use for this is:
print "Give me a number: ";
chomp(my $n = );
my $result = eval { 100 / $n };
if ($@) {
errorHandler($@);
}
Perl functions
|
List of all perl functions ord perl function : split Perl function: lc shift
Download perl
download stable version of perl
Perl 5.10.1
|
|