in reply to using reference to subroutine

$a = sub {return @_[0]}; (yes I know....)
Yes you know? You know that this is an array slice? I think you meant $_[0] there.

Replies are listed 'Best First'.
Re^2: using reference to subroutine
by kotoko (Novice) on Apr 05, 2007 at 12:21 UTC
    I meant $_[0], the yes I know was for writing stupid code.The error was because I have to hand copy the code from one pc to another because one doesn't have internet.

      I meant $_[0], the yes I know was for writing stupid code.

      The error was because I have to hand copy the code from one pc to another because one doesn't have internet.

      The biggest error being not that of using @_[0] instead of $_[0], which is valid syntax and fundamentally does the right thing, but that of not putting the "yes I know..." part behind a comment sign, which does not.