in reply to regex question
Based on the specification I gather, I wouldn't use a regex at all:
my %words = map { $_ => 1 } qw( directory file age action ); while (<>) { print "Could not find '$_' in list\n" unless exists $words{ $_ }; } [download]