in reply to Re^2: Does eval cause that much of a performance hit?
in thread Does eval cause that much of a performance hit?
What are the alternatives
An alternative to your alternatives
my $foo = defined($baz) ? $bar : undef;
or, with a sensible default, as an explicit undef is pretty dumb,
my $foo = defined($baz) ? $bar : 0;
This saves at least a nextstate and an assignment, for no loss of readability.
• another intruder with the mooring in the heart of the Perl
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Does eval cause that much of a performance hit?
by BrowserUk (Patriarch) on May 06, 2009 at 13:50 UTC | |
by grinder (Bishop) on May 06, 2009 at 15:02 UTC |
In Section
Seekers of Perl Wisdom