Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Special cases make special community

by Porculus (Hermit)
on Feb 01, 2009 at 15:49 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-19 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found