[Kc] Scalar + Shift?

djgoku djgoku at gmail.com
Thu Aug 3 07:59:28 PDT 2006


On 8/3/06, Eric <eric at alliances.org> wrote:
> nah...  they're doing some shortcutting.
> my $scalar = shift;
>
> is the same thing as saying:
>
> my $scalar = shift @_;
>
> Depending on the context, it could be pulling parameters off of a function call or pulling the first item off of "the current thing".

That mistake doesn't make me feel so good about what I have learned so
far in Perl, since I am just finishing up Learning Perl 4th edition. I
guess making mistakes makes you remember not to do that again, and
remember there is lots of shortcuts that can be used =).


More information about the kc mailing list