Yes - it is possible to do what you ask, and it is also very efficient. However, monks here will strongly recommend against doing it for various valid reasons relating to maintainability and security.
So - let us attempt to resolve your problem the politically correct, and still efficient way. It turns out that this way is possibly easier to understand too. I'm recommending using a hash which contains subroutine references. The code (Untested, unparsed) will look something like this :
--code to handle main
my %dispach_sub =(
..after reading the data file into $var,