#in foo.cgi my $password = 'thesecret'; require 'thefile.pl'; my $encode = encrypto($password); #in thefile.pl sub encrypto($) { # encryption algorithm ... return $Finished; }