in reply to nested <FILE> read returns undefined?
I'm not sure what you're trying to accomplish here, nor why you think it would be a common thing to do. Anyway, the reason it doesn't work is the reason why you shouldn't normally use for for reading from files (especially large ones), it slurps the whole file into a list in memory first before processing it. So by the time you try to assign to $x you're already at the end of the file and naturally can't read any further. Try using while instead of for.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: nested <FILE> read returns undefined?
by argv (Pilgrim) on Mar 31, 2006 at 06:55 UTC | |
by rjray (Chaplain) on Mar 31, 2006 at 07:03 UTC | |
by tirwhan (Abbot) on Mar 31, 2006 at 08:14 UTC | |
by argv (Pilgrim) on Apr 01, 2006 at 06:39 UTC | |
by tirwhan (Abbot) on Apr 01, 2006 at 08:28 UTC | |
by argv (Pilgrim) on Apr 01, 2006 at 18:43 UTC | |
by graff (Chancellor) on Apr 02, 2006 at 05:07 UTC | |
by argv (Pilgrim) on Apr 01, 2006 at 06:30 UTC | |
by tirwhan (Abbot) on Apr 01, 2006 at 08:44 UTC | |
by argv (Pilgrim) on Apr 01, 2006 at 18:56 UTC |