in reply to Condensing code...golfing with push and return
More readable, too. Shorter gets less readable:sub test { my $result = $object->createNewObject() || return; push @results, $result; return $result; }
sub test { push @results, $object->createNewObject() || return; return $results[-1]; }
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Condensing code...golfing with push and return
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 |