in reply to Re: Bug in perl bitwise or??
in thread Bug in perl bitwise or??

You are possibly correct. I had populated the value with unpack and an A10 value in that position. However, I thought it was in numeric context since the debug statement just before it had no single quotes around it.

By the way its v5.6.1 on HPUX.

Thanks

Replies are listed 'Best First'.
Re^3: Bug in perl bitwise or?? (x)
by tye (Sage) on May 21, 2003 at 22:42 UTC

    (Perhaps unfortunately) The "x" command in the Perl debugger determines whether to put quotes around a value based on whether the value matches /^\d+(\.\d*)?\Z/ (see dumpvar.pl), not based at all on whether or not Perl considers the value to be a string, a number (of one of several types), or both. For example:

    DB<1> x -1 0 '-1' DB<2> x 1e19 0 '1e+019' DB<3> x "123" 0 123
    "Go figure."

                    - tye
Re: Re: Re: Bug in perl bitwise or??
by shemp (Deacon) on May 21, 2003 at 22:31 UTC
    One way to test my theory would be to, immediately before the |= , add zero to each variable. That would force numeric context for the addition, and perl would still consider the vars as numbers for the |=.