#!/usr/bin/perl use warnings; use strict; print "\nfoo script\n\n"; my $action = shift(@ARGV); die "Usage here\n" unless $action; my $handler = can main "_$action"; die "Unknown action '$action'\n\nUsage here\n" unless ref $handler; my %params; GetOptions(\%params, qw(various options here)); # do more stuff with %params here $handler->(\%params); exit; ######################################################################## ######################################################################## use Getopt::Long; # use Other::Modules::Here; # .. etc ..