Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
i tried to find the answer by RTFM, but have you ever tried searching the documentation for "for"?! Anyhow, here is my problem: for LIST and for (;;) are behaving differently from what I would expect. Granted, I've never tried using for (;;) in Perl before, but I've used it a lot in C and the chess client I am working on seemed to call for it. Also, I've only used anonymous subrutines a couple times, and never as closures. After reading the section of perlfaq7 on closures, I think I understand it, but I don't understand what is going wrong in my code. So obviously I don't. Here is the code:
Pass 1 works as planned, but pass 2 contains a logic error. All the code refs in pass 2 output the same thing. If somebody could explain this, I would be very grateful. Paris Sinclair | 4a75737420416e6f74686572 pariss@efn.org | 205065726c204861636b6572 http://sinclairinternetwork.com In reply to for loops, closures by Aighearach
|
|