#!/usr/bin/perl use strict; use warnings; my $name = shift; my %updates = ( test => \&update_test, hello => \&update_hello, ); $updates{$name}->(); sub update_test { print "!test\n" } sub update_hello { print "hello!\n" }