GetOptions ( 'opta=s' => \&a, 'optb=s' => \&b, 'optc=s' => \&c, )or die "not working: $!\n"; sub a { blabla } sub b { blabla } sub c { blabla }