Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

davorg (18)

davorg
  dave@dave.org.uk
http://dave.org.uk/
Yahoo! ID: daveorguk (Add User, Send Message)

Hacker, author, trainer

Technorati Profile [technorati.com]

Journal of davorg (18)

Wednesday November 30, 2005
06:52 AM

Interesting Perl Typo

[ #27800 ]

Took me a while to work out what this interesting Perl typo was doing.

$ perl -le 'print rand[10]'
24306146.4335798
$ perl -le 'print rand[10]'
49138251.923694

Obviously what was intended was rand(10).

Can you work out what's going on before reading the discussion on Perlmonks?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.