use MyModule qw( MyFunction ); BEGIN { MyFunction('HelloWord'); } # Execute as soon as compiled.