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 making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2016-08-25 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (360 votes). Check out past polls.