Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Understanding Split and Join

by duff (Vicar)
on Dec 28, 2006 at 14:44 UTC ( #592054=note: print w/replies, xml ) Need Help??


in reply to Understanding Split and Join

I'd put more emphasis on the fact that the first argument to split is always, always, always a regular expression (except for the one special case where it isn't :-). Too often do I see people write code like this:

@stuff = split "|", $string; # or worse ... $delim = "|"; @stuff = split $delim, $string;
And expect it to split on the pipe symbol because they have fooled themselves into thinking that the first argument is somehow interpreted as a string rather than a regular expression.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://592054]
help
Chatterbox?
[marto]: good morning all
[Corion]: Hi marto!
[marto]: hey Corion, good weekend?

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2017-08-21 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (319 votes). Check out past polls.

    Notices?