Mumia W. wrote:
> On 06/17/2007 12:36 AM, Mathew Snyder wrote:
>> [...]
>> In the debugger I've set the 'w' command to watch the variable
>> containing the
>> day being looked for ($day).  I would have thought $day stays the same
>> throught
>> an iteration of the while loop but the debugger keeps stopping to tell
>> me it
>> switched from '2007-06-15' (for instance) to ''.  I then continue and
>> it tells
>> me it switched back from '' to '2007-06-15'.  Is it supposed to do that?
>> Shouldn't the $day variable remain constant?
>> [...]
> 
> The variable $day on line 50 is restricted to the scope of the for loop.
> I suspect that $day becomes empty or undefined when execution goes into
> a subroutine who's scope is outside of the for loop.
> 
> 
> 
> 

That actually makes sense.  It hadn't occurred to me that it would be
reinitialized during each iteration.

Thanks
Mathew
--
Keep up with me and what I'm up to: http://theillien.blogspot.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to