Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: split function not working as expected

by kcott (Archbishop)
on Jul 28, 2015 at 03:39 UTC ( [id://1136540]=note: print w/replies, xml ) Need Help??


in reply to RE: split function not working as expected[SOLVED]

G'day lonewolf28,

If you look at the documentation for the split function, you'll see that the first argument to split is a "PATTERN".

Your "PATTERN" is: zero-length-string OR zero-length-string

And, with the last part being totally redundant, just: zero-length-string

The output is entirely to be expected. The split documentation discusses outcomes with zero-length patterns.

A better "PATTERN" would be: /[|]/

See also: Perl Regular Expressions Tutorial

— Ken

Log In?
Username:
Password:

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

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

    No recent polls found