in reply to Parsing commandline with subcommands

Not necessarily a good reply this might be but in one of my projects in C, I used the ReadLine Library to make a shell prompt. I guess Perl too has a port of the ReadLine library. Or maybe (again like C), you can use the getopt() function. Perl Doc has examples