while ( my $line = <$filehandle> ) { if ( $line = m/$regex/ ) { } }