There are very few hard limits on what you can do in Perl, but this is one of those places that you don't want to go to. One normal way about it is to use a dispatch table
my %call = (
'name_1' => sub { function body }, # inline, anonymous subroutine
'name_2' => \&func, # or take a reference to a sub
...
);
where sub {}
is an anonymous subroutine, so the value for name_1
is a code reference.
Then you use it as
my $name = <STDIN>;
chomp $name;
$call{$name}->(@arguments); # runs the code associated with $name
This finds the key $name
in the hash and dereferences its value, the coderef; so it runs that code.
Documentation: overview perlintro, tutorial perlreftut, and references perlref and perlsub.