Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Loop will not save into the array

by graff (Chancellor)
on Aug 18, 2005 at 05:05 UTC ( [id://484677]=note: print w/replies, xml ) Need Help??


in reply to Re: Loop will not save into the array
in thread Loop will not save into the array

Roger: If you read far enough down in "perldoc -f split", you'll find that  split " ",$string and  split /\s+/,$string are in nearly equivalent (except in how they treat initial whitespace in $string).

Using a single quoted space character as the split pattern is one of those nifty little bits of perl magic that is meant to save unnecessary typing, giving the same behavior as a bare "split" call with no regex pattern. (But  split / /,$string -- not using quotes -- really does split on every individual space character.)

But I think you're right to suggest that the OP should add the extra parens, to make sure there's no confusion about which args are supposed to go to "split" as opposed to "join".

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-26 06:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found