while ( ) { if ( /^SOURCES/ && /\\$/ ) { $_ .= ; redo; } elsif ( /^SOURCES/ ) { print; } } #### my $data; while ( ) { $data .= $_ if /^SOURCES/ || $data && /^\s/; last if $data && !/\S/; } print $data;