sub foo { (+shift)->foo_bar( 'foo', @_ ) } sub bar { (+shift)->foo_bar( 'foo', @_ ) } sub foo_bar { my $self = shift; my ($type, @args) = @_; # Do stuff here } sub unique { my %x; @x{@_} = @_; values %x } sub stringify { join '-', $_[0]->date }
If my function gets to more than 80 characters, including the subroutine name, and/or it isn't a drop-in replacement for where it's called, then I use more than one line, don't directly access @_, and use an explicit return.
(I access @_ for aliasing-type stuff as well, but I'll do it here for brevity.)
Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.
In reply to Re^2: hash slice ? No thanks, I'm about to return...
by dragonchild
in thread hash slice ? No thanks, I'm about to return...
by leriksen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |