No such thing as a small change | |
PerlMonks |
Re: Question about Numbers, Strings & SPLITby erroneousBollock (Curate) |
on Nov 29, 2007 at 04:38 UTC ( [id://653770]=note: print w/replies, xml ) | Need Help?? |
You need to escape '.' in the regular expression like this: split /\./ '.' in a regular expression matches any single character, rather than the period character. Please have a look through perlre. Personally, I like to do: If $fract isn't defined, it'll be evaluated as zero when used numerically. -David
In Section
Seekers of Perl Wisdom
|
|