in reply to $_ and nested while loops w/angle operator

diotalevi explained the reason, let me just provide the corrected code:
while (($_=<FH>) !~ /^\"\@ENDQUERY\"/) {
(Note that this code will get into trouble if there is no @ENDQUERY at the end of the file...

Replies are listed 'Best First'.
Re: Re: $_ and nested while loops w/angle operator
by muba (Priest) on Apr 05, 2004 at 20:31 UTC
    Easy to fix that.
    while ((($_=<FH>) !~ /^\"\@ENDQUERY\"/) or (eof FH)) {
    Update: I think you'd better write it like:
    while ((($_=<FH>) !~ /^\"\@ENDQUERY\"/) and (not eof FH)) {