my $fname = "while_multi_cond.dat"; my $s1 = ""; open( FP, "<", $fname ) or die "Can't open $fname: $!"; while() { if (/^_start/) { # This works as expected # while( ) { # if (/^_stop/) { last } # I'm trying to replace it with this: while( () && (!/^_stop\n/) ) { # but seems to break the functionality of $_ $s1 .= $_; } } if ($_) { print("$_") } } print("\$s1= \n<$s1>");