in reply to Re^6: Line numbers
in thread Line numbers

Thanks for setting me straight Rolf. I was getting an error because I didn't have the say feature enabled. I guess I shouldn't have stated it so matter-of-fact. I was so sure I had it figured out.

I am still a little confused about this and why anonymous' code works...

print '', (caller(0))[0];

and why this gets a syntax error:

print (caller(0))[0];

Replies are listed 'Best First'.
Re^8: Line numbers
by LanX (Saint) on Mar 19, 2012 at 18:22 UTC
    Because parens around sub-args are optional.

    print '', (caller(0))[0]; means print ( '', (caller(0))[0] );

    But providing explicit parens after a sub-name will disable automatic grouping of args.

    Cheers Rolf

      Ahhh, I think I understand. That is why this does work, right?

      print ((caller(0))[0]);