in reply to doing something with the rest of a file after matching a keyword
Slurp the whole file into a variable and use a regex to extract the part you want - or delete the part you don't want.
You might have to 'massage' the regex a little to fit your exact needs ...open my $file, '<', "$filename" or die $!; my $text = do { local $/; <$file> }; # get the part you want my ($wanted) = $text =~ /Well(.*)/s; # or delete the stuff you don't want $text =~ s/.*Well//s;
-- Hofmator
|
|---|