Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^8: rand() function on Windows systems (pure Perl)

by BrowserUk (Patriarch)
on Dec 31, 2016 at 20:18 UTC ( [id://1178749]=note: print w/replies, xml ) Need Help??


in reply to Re^7: rand() function on Windows systems (pure Perl)
in thread rand() function on Windows systems

Hm. srand always returns 1 regardless of its argument on my system:

print srand( $_ ) for 1 .. 10;; 1 1 1 1 1 1 1 1 1 1

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". The enemy of (IT) success is complexity.
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^9: rand() function on Windows systems (pure Perl)
by bakiperl (Beadle) on Dec 31, 2016 at 20:36 UTC

    That's strange. I get the same result on my systems using old and new versions of Perl.

    print srand( $_ )."\n" for 1 .. 10;; 1 2 3 4 5 6 7 8 9 10

      From the pod:

      starting with Perl 5.14, it returns the seed.
      . My default perl is still 5.10.1.

      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". The enemy of (IT) success is complexity.
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-09-19 17:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (25 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.