#obtain the length to match according to ps aux
print "#Enter the block just once\n";
last if $strindex;
$strindex = index($_, "STAT");
#obtain how characters the RegEx should not match
} #no more of this besides the first line
Also, take a look at perl - perldoc.perl.org. Here you'll find links to all the Perl manual pages. I wouldn't suggest attempting to learn everything in all that documentation; rather, just get a feel for where that information can be found. Once you are familiar with what's available, looking up specifics is usually a fairly easy task.