in reply to Re: Win32::Console problem
in thread Win32::Console problem

Thanks! Seems so simple and it works!

Now, I do have a non essential quest for knowledge....why did it work on V5.6 but no V5.8?

Replies are listed 'Best First'.
Re^3: Win32::Console problem
by syphilis (Archbishop) on Nov 23, 2009 at 06:12 UTC
    why did it work on V5.6 but no V5.8?

    The rules regarding automatic flushing of the STDOUT buffer changed from perl-5.6 to perl-5.8. Setting $| (or incrementing it from 0 to 1, as per BrowserUk's approach) is the way to make sure that the perl-5.8 STDOUT buffer gets flushed in much the same way as happened automatically with perl-5.6.

    For a simple demo of the difference, the following outputs hellogoodbye on 5.6, but goodbyehello on 5.8:
    perl -e "print STDOUT \"hello\";print STDERR \"goodbye\""
    Setting $| will ensure that hellogoodbye is output on both 5.6 and 5.8:
    perl -e "$|=1;print STDOUT \"hello\";print STDERR \"goodbye\""
    Cheers,
    Rob
Re^3: Win32::Console problem
by BrowserUk (Patriarch) on Nov 23, 2009 at 05:27 UTC
    why did it work on V5.6 but no V5.8?

    I have no idea.


    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.