
shawnhcorey
Enthusiast

Oct 1, 2010, 1:48 PM
Post #2 of 2
(198 views)
|
|
Re: [dissectcode] Why is "2*4" - 0 equal to 2??
[In reply to]
|
Can't Post
|
|
Because it's a string. When converting string to numbers, Perl looks for a number but stops at the first character that cannot part of a number, in this case, the asterisk. So, Perl thinks the number for "2*4" is two. __END__ I love Perl; it's the only language where you can bless your thingy. Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib. Get Markup Help. Please note the markup tag of "code".
|