#!/usr/bin/perl # file func1.al package General; # the function must be compiled into its package. sub func1 { # main program my ($arg_a, $arg_b) = @_; ; # ... more perl code # end main } unless (caller) { func1(@ARGV); } 1; # <-- important!