⭐ in reply to Why does $string++ work the way it does?
BTW, perl's definition of a number is pretty complex. "-1e3garg" + "+4ee3" will net you 1004.
$a="-1e3ble"; $b="+4.33eeq"; $c="aaa999"; $d="a9z9z9"; print "a = $a and b = $b\n"; print "c = $c and d = $d\n"; print "a + b = ". $a+$b . "\n"; print "c + d = ". $c+$d . "\n"; print "int(b) = ". int($b) . "\n"; print "++a = ". ++$a . "\n"; print "++b = ". ++$b . "\n"; print "++c = ". ++$c . "\n"; print "++d = ". ++$d . "\n";
try out that code and see what I mean. Note what happens to $c when the numbers flip and notice that $d goes poof. =)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: Why does $string++ work the way it does?
by I0 (Priest) on Dec 26, 2000 at 05:23 UTC |