in reply to hash and arrays

Everybody else gave useful answers. I simply can't help myself.

=> is used when you want to compute a minimum; as, for example, [ $a => $b ]->[ $b <= $a ].

Replies are listed 'Best First'.
Re^2: hash and arrays
by repellent (Priest) on Nov 11, 2008 at 08:13 UTC
    Not quite true. I will not recommend the use of

    as it relies on too much syntax magic.

    The first set of brackets [ ] is used to indicate an anonymous array, whereas the second set of brackets ->[ ] de-references the array.

    => is used as a fat comma (not greater-than-or-equal-to), whereas <= is used as less-than-or-equal-to.

    Hence,
    [ $a => $b ]->[ $b <= $a ] is same as [ $a, $b ]->[ ($b <= $a) ] which either evaluates to [ $a, $b ]->[0] # returning $a or [ $a, $b ]->[1] # returning $b