Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Special cases make special community

by Porculus (Hermit)
on Feb 01, 2009 at 15:49 UTC ( #740547=note: print w/replies, xml ) Need Help??

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";

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2023-02-06 12:52 GMT
Find Nodes?
    Voting Booth?
    I prefer not to run the latest version of Perl because:

    Results (34 votes). Check out past polls.