in reply to Problem with command-line option parsing

It would help if you could tell us what it's not doing that you think it should be doing but I think the following will clean up the first half of your code.

sub usage { print "usage: proggie [-q] [-i] [-force] search replace directory\ +n"; exit 2; } my @args; my ($interactive,$quiet,$force); foreach (@ARGV) { $interactive++, next if ($_ eq '-i'); $quiet++, next if ($_ eq '-b'); $force++, next if ($_ eq '-force'); usage() if /^-/; push @args,$_; } usage() if @args != 3; ($search,$replace,$dir) = @args;
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';