http://qs321.pair.com?node_id=127386


in reply to Re: Poor Man's Prototyping?
in thread Poor Man's Prototyping?

I'd even nuke the shift. I replace:

sub dosomething{ my $foo = shift; my $bar = shift;

with

sub dosomething{ my ($foo, $bar) = @_;

That gets all the args and their order right up on the first line of the sub, where it's easier to see. I tend to agree with the Linux kernel CodingStyle document when it says that if you have more than 2-3 args there's probably some re-factoring in order. Cutting and pasting your function calls just seems... icky.