Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: One piece of code, two mysteries!

by Athanasius (Archbishop)
on Oct 05, 2012 at 02:20 UTC ( [id://997359]=note: print w/replies, xml ) Need Help??


in reply to One piece of code, two mysteries! (UPDATED.)

I don’t have any answers, but perhaps the following will shed some light?

12:08 >perl -v This is perl 5, version 14, subversion 2 (v5.14.2) built for MSWin32-x +86-multi-thread ... 12:08 >perl 318_SoPW.pl 1 2 Use of uninitialized value in print at 318_SoPW.pl line 27. Use of uninitialized value in print at 318_SoPW.pl line 27. 1 2 3 Use of uninitialized value in print at 318_SoPW.pl line 27. Use of uninitialized value in print at 318_SoPW.pl line 27. Use of uninitialized value in print at 318_SoPW.pl line 27. 1 2 3 1 2 3 12:08 >

but

12:11 >perl -v This is perl 5, version 16, subversion 0 (v5.16.0) built for MSWin32-x +86-multi-thread-64int (with 1 registered patch, see perl -V for more detail) ... 12:11 >perl 318_SoPW.pl 1 2 1 2 1 2 3 1 2 3 1 2 3 1 2 3 12:11 >

In neither case do I get a 4 in the output, as you do. Looks like there’s a Perl bug somewhere...

Update 1: Running on Vista 32-bit.

Update 2: With the local $_ line commented out, I get the following output (same for both perl versions):

17:59 >perl 318_SoPW.pl Thread 1 terminated abnormally: Modification of a read-only value atte +mpted at 318_SoPW.pl line 15. Thread 2 terminated abnormally: Modification of a read-only value atte +mpted at 318_SoPW.pl line 15. 18:00 >

Athanasius <°(((><contra mundum

Replies are listed 'Best First'.
Re^2: One piece of code, two mysteries!
by BrowserUk (Patriarch) on Oct 05, 2012 at 02:50 UTC

    Interesting, thank you.

    I'd tried it on a mix of 32 & 64 bit Perl's ranging from 5.8.9 through 2x 5.10's, 2x 5.12's, 3x 5.14s with the same results. Amazing how I've only just encountered it, shortly after its been fixed.

    Did you try commenting the local $_ line?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    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.

    RIP Neil Armstrong

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://997359]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-03-19 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found