Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: My split command isnt working - please advise

by BrowserUk (Patriarch)
on May 23, 2011 at 12:10 UTC ( [id://906286]=note: print w/replies, xml ) Need Help??


in reply to My split command isnt working - please advise

This:my @nums = split(/\\./, $sf[0]); is attempting to split the string on the text \.

Ie. You've escaped the backslash, so it is taken as a single literal and the dot will match any character.

Change that to: my @nums = split(/\./, $sf[0]);

That is escape the dot '.' with a (single) backslash so that the dot is taken as a literal.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-24 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found