in reply to What is (a => b => c) ?

Actually, to be more accurate: You are only correct if strict is off. But since everyone uses strict (right? ;-) ), @x = (a => b => c); is like @x = ("a", "b", c); (note the quotes), and the final "c" also needs to be quoted unless it's a function call.

Replies are listed 'Best First'.
Re^2: What is (a => b => c) ?
by Schmunzie (Beadle) on Mar 27, 2015 at 16:04 UTC
    Doesn't it need to be &c to be a function call?

      Not if you declare/define it first:

      no strict; sub c { print "see?\n" } @x = ( a => b => c );

      or

      no strict; sub c; @x = ( a => b => c ); sub c { print "see?\n" }

      But not:

      no strict; @x = ( a => b => c ); sub c { print "see?\n" }

      UPDATE: corrected 2nd example (used &c; which called the sub ... oops)

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)
      
        That's fascinating, amazing and scary in equal measure.

      Not at all.

      Prepending & to a sub call causes the sub call to ignore the sub's prototype.

      Prepending & to a sub call with no parameter list specified (not even ()) causes the sub call to ignore the sub's prototype, and forgoes the creation of a localized @_.

      These are not thing you should ever need to do. Because it must be followed by a sub call, & has the side effect of forcing the following word to be treated as the name of a sub, but that's just a side effect.