in reply to Re^2: Nested While Loop Problem
in thread Nested While Loop Problem

I am having a little difficulty interpreting your question, so if this answer is off point I apologize. I think what is happening is that since you are accessing the $dir variable outside of the conditional loop, you are caching a value of $dir from a previous traverse of the loop. Perhaps this could be fixed with something along the lines of

if ($fsline =~ /(.:\\.*)/){ $dir = $1; print "$dir\n"; #works fine here } else { next; }

Replies are listed 'Best First'.
Re^4: Nested While Loop Problem
by Smith (Initiate) on Feb 06, 2009 at 16:26 UTC
    You interpreted my question perfectly, thank you. This fixes my problem. I had tried using next but not with the else. So close but so far away.

    Thanks very much for your help and fast response.