C
chaitask
Hi folks,
As part of some operation that fetches disk free space from a Windows
machine, I get numbers like 3,45,198 (comma-separated....you get the
idea right?). Since a comma is a list separator in Perl, I can't use a
number like that in my operations and so I decided to replace globally
all commas with underscores because Perl seems to OK it.
The result 3_45_198 works well in numeric comparison scenarios (less
than, greater than, etc) but not in any operations like addition,
multiplication, etc (it actualls adds/multiplies the other operand
to/with 3, the leading number in 3_45_198, and returns the value). Does
it mean that numerals like this don't function as "proper" numerals?
Do I really have to delete the underscores or is there a way to make
Perl understand that I want it to function like a normal numeral?
Thanks a million,
Krish.
As part of some operation that fetches disk free space from a Windows
machine, I get numbers like 3,45,198 (comma-separated....you get the
idea right?). Since a comma is a list separator in Perl, I can't use a
number like that in my operations and so I decided to replace globally
all commas with underscores because Perl seems to OK it.
The result 3_45_198 works well in numeric comparison scenarios (less
than, greater than, etc) but not in any operations like addition,
multiplication, etc (it actualls adds/multiplies the other operand
to/with 3, the leading number in 3_45_198, and returns the value). Does
it mean that numerals like this don't function as "proper" numerals?
Do I really have to delete the underscores or is there a way to make
Perl understand that I want it to function like a normal numeral?
Thanks a million,
Krish.