|
Hi, there,
I wrote such a short code
$count=10;
while($count--){print "$count\n";}
my expected output is "10 9 8 7 6 5 4 3 2 1",
however, its real output is "9 8 7 6 5 4 3 2 1 0".
any explaination?
thanks.
|
|
|
not really that strange.
the first time through the loop
while($count--) # count evaluates to 10 and is decremented to 9
{
print "$count\n"; # count is 9 because you just decremented
}
semper fi...
|
|
|
|
|
|
|
|