code snippet as below.
while(@someNameArray){ print( __FILE__.__LINE__." $_ \n");# $_ correct if(!($finder->isExist($_))) { print( __FILE__.__LINE__." trace \n"); #not suffice if condition and didn't go here. ...... }else{ print( __FILE__.__LINE__." $_ \n");# $_ wrong } }
Problem description: As commented, the two print display different $_ in sequence. It seems only in $finder->isExist($_) could have changed the value of $_ unexpectedly. If a C++ function, it's probably because the called function's stack has been ruined by stack oveflowing. I'm not sure whether advanced language as Perl, will have this problem. Or why the passing value have been changed in my case?
In reply to Does perl sub using stack and possible to crash? by anaconda_wly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |