in reply to Re: shift doesn't DWIM
in thread shift doesn't DWIM

I agree entirely. From a Huffman-encoding viewpoint, I'd say doing shift @a to discard the first element of the array and doing $_ = shift @a to put that discarded element in $_ is a far better allocation of characters than () = shift @a for discarding and shift @a for storing in $_. Not to mention those empty LHS parens look odd to some folks.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^3: shift doesn't DWIM
by GrandFather (Saint) on Jul 12, 2005 at 20:25 UTC

    Very nice reply! With a rationale like that prodding my brain maybe I won't fall into this particular hole that I've invented for myself again.


    Perl is Huffman encoded by design.