in reply to Naming Subs

Well, you could do something like that but you don't really want to anyway. You should validate the user's input.

My suggestion is to use a hash of sub references.

sub he_eats { print "You eat @_!\n"; } sub he_sleeps { print "You sleep @_!\n"; } sub he_moves { print "You move @_!\n"; } my %actions = ( eat => \&he_eats, sleep => \&he_sleeps, move => \&he_moves, ); while (<>) { chomp; my ($action, @args) = split; if (exists $actions{$action}) { $actions{$action}->(@args); } }

This is my 600th post.

-sauoq
"My two cents aren't worth a dime.";