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

Doesn't it need to be &c to be a function call?

Replies are listed 'Best First'.
Re^3: What is (a => b => c) ?
by jeffa (Bishop) on Mar 27, 2015 at 16:12 UTC

    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.
Re^3: What is (a => b => c) ?
by ikegami (Patriarch) on Mar 27, 2015 at 18:17 UTC

    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.