in reply to $_, one lexical scope removed

Are you trying to win an obfuscated code contest? Even if these were possible, they wouldn't be a good thing to do.

Replies are listed 'Best First'.
Re^2: $_, one lexical scope removed
by sleepingsquirrel (Chaplain) on Jul 15, 2004 at 19:49 UTC
    Are you trying to win an obfuscated code contest?
    Essentially. I'm thinking of writing a paper entitled "Monads for Perl" and I was trying to make my example code as side-effect free as possible.


    -- All code is 100% tested and functional unless otherwise noted.
      I was trying to make my example code as side-effect free as possible

      Using $_ doesn't mean your code is side-effect free, just that the side-effects are implicit. This is the reason you should use $_ with caution. It can be a nice way to increase clarity, but as your question ably demonstrates, can often introduce much confusion.