On Wed, 11 Jul 2001, Sebadamus wrote:
> Does anybody knows why I cant make this to work as I want? :-)
>
> while (<ARGV> and $_!=~/End of list/)
> {
> bla
> bla
> bla
> }
>
> So, with this I want to process the file in <ARGV> until EOF, and each line
> must be distinct than "/End of list/". So, if it is EOF or the current line
> is that string... the WHILE should exit...
Reorganize your logic, and test for $_ *inside* the block:
while (<ARGV) {
last if /End of list/;
bla
bla
bla
}
Also, there is no !=~ operator, it's just !~.
-- Brett
------------------------------------------------------------------------
The faster we go, the rounder we get.
-- The Grateful Dead