Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Problem with while loop inside a foreach loop

by choroba (Chancellor)
on May 03, 2013 at 11:47 UTC ( #1031870=note: print w/replies, xml ) Need Help??


in reply to Re: Problem with while loop inside a foreach loop
in thread Problem with while loop inside a foreach loop

Exactly. Looping over the file content the value of $_ is modified, which modifies the elements of @floors. The last value is undef (read at each file's end), so @floors ends up containing undefs after going through building1. Try adding the following line after the beginning of the foreach (@floors) loop:
warn "FLOORS: @floors.\n";
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031870]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2016-10-01 23:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (9 votes). Check out past polls.