in reply to Re: Saving Standard Output (overloading print())
in thread Saving Standard Output (overloading print())

Just to note - there's a function in perl called log, so you might want to quote $opts{log} (so it becomes $opts{'log'}).

update: I'm not saying that it would break anything, just that it might be confusing. When I looked at it, I immediately thought of the log function, not the log key. No biggie, but it might be worth quoting.

Replies are listed 'Best First'.
Re: Re: Re: Saving Standard Output (overloading print())
by Aighearach (Initiate) on Aug 11, 2001 at 03:15 UTC
    Nyet. If you want log() then you'll need $opts{+log}, just like normal. The default idea is for a hash key to be a string, so it's the log() not the 'log' that needs clarification. Note that $opts{log(5)} isn't ambiguous, only the implicit illegal log of 0 that you get without giving it an argument.

    (I'd love to see the code that uses the log of zero for a hash key...)
    --
    Snazzy tagline here