I'm mildly suprised that no-one caught the problem in the following line:
$process = qr/\s+(?:\d+[:])+?\d+\s+.*?$ARGV[0].*?\s*$/;
Because I'm using user input in a regexp, I should have done one of the following:
# use \Q and \E
$process = qr/\s+(?:\d+[:])+?\d+\s+.*?\Q$ARGV[0]\E.*?\s*$/;
# or enclose in an eval
eval { $process = qr/\s+(?:\d+[:])+?\d+\s+.*?$ARGV[0].*?\s*$/; };
if($@) { ... }
I chose to go with the
eval { ... } version mainly because I actually
want regexp functionality on the command line.