in reply to Re^5: STDERR Restore after redirect (updated)
in thread STDERR Restore after redirect

And what to make of this?

When to Use my and When to Use local Always use my; never use local.

  • Comment on Re^6: STDERR Restore after redirect (updated)

Replies are listed 'Best First'.
Re^7: STDERR Restore after redirect (updated)
by AnomalousMonk (Archbishop) on Apr 28, 2018 at 21:53 UTC
    Always use my; never use local.

    Personally, I always choose lexicals over package-global variables if I have a choice. But if you're working with STDOUT and STDERR, then that's what you've got to work with, and local is the right tool. (And don't blame the poor, innocent  SEND: { ... } block if you've got code somewhere that's stepping on your global file handles. :)


    Give a man a fish:  <%-{-{-{-<