Assign array values to hash keys but with the same value:
@hash{ map {$_ } @array} = ($scalar) x scalar @array;

Get all pids with a keyword in args:
my $pids  = join ' ', map {/^\s*(\d+)\s+/}
            grep /$match/, `ps axk pid o pid,args`;

Newlines: reading files that were created on other platforms