I'm reading a comma-separated-value ascii text file containing numerical data, e.g. "123,234,456" on each line.
I'm using 'split' to separate the fields of each line into three arrays e.g. ($a[$i], $b[$i], $c[$i]) where $i is the line number.
My question is, what is actually stored in $a[$i]? Is it the string "123" or the number 123.0? And does it make any difference to the perl programmer?
I'm using the results entirely in numerical calculations, so I want to do all conversion of string-to-number (if any) at the time I read the file and get it over with early.
I've been using the perl debugger to print these variables but I can't (yet) tell whether it's printing a string or a number.
If the perl docs answer these question explicitly I've missed it, so please point me to the appropriate docs.
Thanks for your time!
In reply to When does '123' become the number 123.0? by wa1ter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |