#!/usr/local/bin/perl -w use strict; use diagnostics; my $str="foo bar -\"weenie roast\" +\"'foo' bar\" \\' -baz +boo +bee / +ben fat faz -slim 'ooga booga' 'fee fie \\' foe fum' \\'do ray\\'"; my (@KeysNeed,@KeysAvoid,@Keys); 1 while $str =~ /\+(\w+|((?