anaconda_wly has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Does perl sub using stack and possible to crash?
by Corion (Patriarch) on Jan 17, 2013 at 10:13 UTC | |
Re: Does perl sub using stack and possible to crash?
by bulk88 (Priest) on Jan 18, 2013 at 09:05 UTC |
Back to
Seekers of Perl Wisdom