Perl Monk, Perl Meditation | |
PerlMonks |
Re: My split command isnt working - please adviseby BrowserUk (Patriarch) |
on May 23, 2011 at 12:10 UTC ( [id://906286]=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|