in reply to Re: print statement changes results!
in thread print statement changes results!

So you think one has to use the stringified version of the value?

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^3: print statement changes results!
by BrowserUk (Patriarch) on Jun 06, 2011 at 18:11 UTC

    The values return from $-[0]/$+[0] are integers stored in the IV part of the scalar.

    Interpolating them in the print statement will have the side effect of forcing the PV slots to be populated with the stringified versions of those integers.

    If the XS code that is behind this VShape object is only looking at the PV slot, that would explain why the print statement has the effect of making the code work.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.