Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: return if defined

by AnomalousMonk (Chancellor)
on Dec 20, 2012 at 13:42 UTC ( #1009746=note: print w/replies, xml ) Need Help??


in reply to Re^2: return if defined
in thread return if defined

Clever, but maybe a little too clever. This isn't the clearest construct in the world ...

But I thought the whole point of the OP was to be too clever by half, and clarity be damned.

IMHO, the pair of statements
    my $existing_result = $self->find_by_something(@args);
    return $existing_result if (defined $existing_result);
is perfectly clear and sufficiently unclever to help me avoid future foot trauma.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009746]
help
Chatterbox?
[Corion]: ;)
[Discipulus]: for the moment I just lead the Perl 99 bottle of beer ladder..
[Discipulus]: fibonacci in 34.. uh!!
[choroba]: Without totally changing the approach, I can't squeeze it more.

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2017-10-20 09:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (260 votes). Check out past polls.

    Notices?