in reply to shift vs. @_ (where @_ evaluates to 1)

pfaut gave you a good answer, though there are still a couple of thing about your post worth commenting one.

First, you showed code (good), but you didn't actually show how the code was being invoked. In this particular case, the actual invocation wasn't relevant, though it often is. Posting a small, complete fragment increases the odds of getting problems solved.

Last, you can save space (and reader comprehension), by writing idiomatic Perl, like this:

sub getFoo { my($a, $b) = @_; my $strFoo = $a; ...
instead of
sub getFoo { my $a; my $b; my $strFoo; ($a,$b) = @_; $strFoo .= $a;
The former form maps arguments to lexical variables right away, which is friendly to your readers. Making people read further into your subroutine to find arguments increases the likelihood that people will misunderstand what you're doing.

Replies are listed 'Best First'.
Re: Re: shift vs. @_ (where @_ evaluates to 1)
by P0w3rK!d (Pilgrim) on May 09, 2003 at 18:46 UTC
    I understand your perspective, however most of the questions I ask are recoded to address the entire audience, not just the pros.

    Also, no one has ever lost track of my code, if that ever occurs, I will have to consider a leave-of-absence from the monestary, be caned, or disrobed by Hef's women, or something.

    -P0w3rK!d :)