in reply to Re: Re: Regexing an input stream...
in thread Regexing an input stream...

he/she almost answered it.
while ($line .= <Stream>) { exit if ( $line =~ m/b\n*l\n*a\n*h/m); }

Replies are listed 'Best First'.
Re: Re: Re: Re: Regexing an input stream...
by sergio (Beadle) on Jun 19, 2003 at 13:49 UTC
    He/She did not understand the scope of the request. Probably the posted request was not too clear.

    I don't want to match things on a line by line only and I don't want to modify $/ to read other types of chunks of text. Just set $/= undef.

    The deeper problem is how to apply a regular expression with multiple matches options to a stream so I don't have to load large pieces of the file and to re-start the reglar expression if it fails.

    So far one of the suggestions makes possible sense... if the regex engine can be tricked into working with an expanding buffer.

    Sergio