in reply to RE: Control Flow Puzzle
in thread Control Flow Puzzle
That's really interesting. Why do you prefer that to this:{ $_ = <INFO>; return %Header unless defined $_ and !/^\037/; last if /^\* Menu:/; redo; }
This seems the same to me, only less abnormal.while (1) { $_ = <INFO>; return %Header unless defined $_ and !/^\037/; last if /^\* Menu:/; }
> What are you doing for non 37, non menu lines? Just skipping them?Yes, exactly so. The 37 line marks the end of the 'node'. If the function sees a 'menu' line before the 37 line, it knows that the node contains a menu, and the following code processes the menu up to the following 37 line. Lines that look different are not of interest to this function.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RE: Control Flow Puzzle
by merlyn (Sage) on Nov 16, 2000 at 03:18 UTC | |
|
Re: RE: Control Flow Puzzle
by jeroenes (Priest) on Nov 16, 2000 at 14:45 UTC |