in reply to How do I place a subroutine in an external file and call it?

Hi,

First of all you will create a directory called TEST, after that you will create a package called ( for example ) external_file.pm and inside of this package you will define your subroutine. To access this package in your code :

BEGIN { use TEST::external_file ; }

if you have any problem to create a package, look this site : (link to site containing copyrighted material removed)

Cheers, Toxa

Originally posted as a Categorized Answer.