Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Does split not work with a pipe?

by jethro (Monsignor)
on Nov 09, 2012 at 17:16 UTC ( #1003187=note: print w/ replies, xml ) Need Help??


in reply to [SOLVED] Does split not work with a pipe?

The first parameter of split is a regex pattern, not a string. Now the regex, lets spell it m/|/, matches the empty string. If you read the perldoc of split, you will find the following sentence:

A pattern matching the empty string (not to be confused with an empty pattern "//", which is just one member of the set of patterns matching the epmty string), splits EXPR into individual characters.

PS: Please use strict; use warnings;.


Comment on Re: Does split not work with a pipe?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2015-07-29 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls