in reply to Re: runtime problem; elusive error
in thread runtime problem; elusive error

my crude solution is to use string eval ...

What also seems to work is

Readonly my $_debug_ops => $DBG_RAND+0 | $DBG_KEYS+0 | $DBG_INFO+0;

but I'm not sure if it's the "+0 = force numeric" aspect or the associated pre-evaluation of the variables that's making this work...  (of course, this workaround isn't very satisfying either).

Anyhow, it's probably best to just stay away from using Readonly... (I had also already been bitten by other subtle weirdnesses).

Replies are listed 'Best First'.
Re^3: runtime problem; elusive error
by perl-diddler (Chaplain) on Sep 20, 2007 at 16:57 UTC
    Slightly cleaner (though admittedly, it doesn't quite "hit the spot" for satisfaction) is just or'ing with 0 as the first thing: "$debug_ops = 0 | $DBG_RAND | $DBG_KEYS | $DBG_INFO; That does the same thing (I think) as your +0 in this situation. Not sure how it gets the other value...weird!

    Thanks!
    Linda