in reply to Re^2: randomizing global replacement
in thread randomizing global replacement

rand@a is just rand(@a) without the optional (). @ can't be part of the word beginning "rand", because it isn't a valid identifier character, so it's treated as a new token. The int() isn't necessary since array elements are automatically int'd (e.g. $a[3.14] automatically gets you $a[3]).

Replies are listed 'Best First'.
Re^4: randomizing global replacement
by GrandFather (Saint) on Jan 30, 2007 at 04:32 UTC

    I did consider putting a space in (rand @a), but decided that was making it too easy. Besides, the OP didn't use much white space so I was just being consistent. :D


    DWIM is Perl's answer to Gödel