in reply to Regex confusion

If all lines that you are matching the regex are in the same format and you want to grab things from the fields (delimited by spaces), you might want to split the line into an array and then just grab the fields you want. for example to grab the things you want in the line you might want something like:
my @line_array = split /\s+/,$p->{cmd}; my $procType = $line_array[0]; my $procName = $line_array[2];

if you want to use a regular expression you could change it to (untested): /(\w+)\s+[^\s]+\s+(\w+)\s+[^\s]+\w+\s+[^\s]+(\w+)/

which is vastly more complicated than with just a split. Note, that the + after the \s is only necessary if there is a chance there is more than whitespace character in those locations.

-enlil