- or download this
eval {
# Code that might die
}; if ($@) {
# Catch area
}
- or download this
sub foo { return undef; }
my @x = foo();
if (@x) { print "foo() succeeded\n" } else { print "foo() failed\n";
- or download this
# Create an ID to name hash
my %hash = map { $_->id, $_->name } @Objects;
...
# Create an ID to name hash
my %hash = map { $_->id => $_->name } @Objects;