In general Perl has a philosophy of "Do what I mean" (DWIM). In the context of numbers and strings Perl converts numbers to strings in a string context and converts strings to numbers in a number context.
What determines the context?
You can force a number context by using +0 and string by .'' (empty quoted string):
my $NumericValue = "10" + 0; my $StringValue = 10 . '';
In reply to Re: Adding hash values together
by GrandFather
in thread Adding hash values together
by MonkPaul
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |