seaver has asked for the wisdom of the Perl Monks concerning the following question:
Lets say I want to do this:
How far could this be condensed?sub test{ my $result = $object->createNewObject(); if($result){ push @results, $result; return $result; }else{ return undef; } }
Cheers
Sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Condensing code...golfing with push and return
by Aristotle (Chancellor) on Oct 10, 2003 at 17:35 UTC | |
by liz (Monsignor) on Oct 10, 2003 at 17:46 UTC | |
by Aristotle (Chancellor) on Oct 10, 2003 at 17:58 UTC | |
by tye (Sage) on Oct 10, 2003 at 21:16 UTC | |
by Aristotle (Chancellor) on Oct 10, 2003 at 22:25 UTC | |
|
Re: Condensing code...golfing with push and return
by BrowserUk (Patriarch) on Oct 10, 2003 at 23:12 UTC |