in reply to Re: For clarity and cleanliness, I'd recommend...
in thread looking for a good idiom: return this if this is true
This works fine, and does not clobber $_.
#!/usr/bin/perl -w use strict; print test(), $/; sub subtest { return 4 } sub test { return $_ if ( local $_ = subtest() ); # continue return 'false'; }
|
---|
In Section
Seekers of Perl Wisdom