in reply to Re^3: string to number via data dumper
in thread string to number via data dumper
Ken said it all, but just in case you have trouble understanding his example, just change:
my $n= "$val+8"; print $n;
to:
my $n= $val+8; print $n;
In the first code snippet above, you are constructing a string composed of the concatenation of your value (in string form) and the "+8" string. In other words, you are just doing string manipulation, no arithmetics. The second code snippet is actually adding the number 8 to your value. Now, if you understood the difference, go back to Ken's example.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: string to number via data dumper
by semipro (Novice) on Sep 29, 2013 at 09:42 UTC |
In Section
Seekers of Perl Wisdom