http://qs321.pair.com?node_id=740547


in reply to Special cases make special community

The "split" special case I always think of is its behaviour with an empty regex, which is completely different to the regular behaviour of an empty regex, which is in turn a special case that does something I would never have guessed in a million years unless I'd read the documentation. :)

(I find it quite useful in split, but I don't think I've ever seen it used otherwise.)

Replies are listed 'Best First'.
Re^2: Special cases make special community
by pobocks (Chaplain) on Feb 02, 2009 at 06:15 UTC

    For the unaware, the general behavior of an empty regex is to function as the last successfully matched regex, if I am not misremembering.

    for(split(" ","tsuJ rehtonA lreP rekcaH")){print reverse . " "}print "\b.\n";