....load pm files here.... $PAGE = "test_function_a"; eval { &$PAGE; }; $@ and die( &nopageerror() ); $PAGE = "test_function_b"; eval { &$PAGE; }; $@ and die( &nopageerror() ); exit; sub test_function_a { print "in test_function_a"; } sub nopageerror { print "The function $PAGE is unknown"; }