Do this if what only what you require is the bit between:
print grep { !/process/ } <>;
perl <script>.pl <input>.txt
prints
ksjhfk
kfh
You could also put this in an array
my @process = grep { !/process/ } <>;
However this would just be each element for each line.
If you wanted them grouped you need something more complex using assertions ( if you do it the inefficent way like i have )
John,
UPDATE:
This would group them
{
local undef $/;
print split /process \s \w+ (.+?) end \s process/xms, <>;
}
P.S.
Don't actually use these methods of doing it, There just other ways to do it. |