package Commands; sub cmd_move {....}; . . . package main; while () { ... if (Commands->can($cmd)) {...} }