in reply to Re^4: What is the + in +shift doing here?
in thread What is the + in +shift doing here?

Really? That's something uniformly agreed on?
Yes. Parentheses connote a function call. + does not.
People write +shift for the purpose of being unclear?
No, and I didn't say they did. They write + to be economical. The side-effect is that they are less clear.
you will find me disagreeing with you
That might carry some weight if you were a real Perl Monk with some reputation of your own, instead of someone hiding behind Anonymous.

If you want to quibble about what it's instead of, it's instead of writing something that connotes a function call.


Caution: Contents may have been coded under pressure.
  • Comment on Re^5: What is the + in +shift doing here?

Replies are listed 'Best First'.
Re^6: What is the + in +shift doing here?
by tye (Sage) on Feb 25, 2005 at 02:14 UTC

    I would write shift(@_) (or, in some cases, shift @_), because I've seen too many cases where it was hard to even find where the argument handling was being done is some complex subroutines. It is nice to only search for @_ and $_[ vs. also having to search for shift without an argument or pop without an argument (the "without an argument" complicates such a visual scan considerably). Well, and I just find avoiding 2 characters to be a silly choice when it reduces code clarity.

    - tye