I often have perl subroutines which I would like to call from other perl routines as well as use on the command line and I'm not quite sure what the best way to do this is.
As an example say that I have a sub called "avg3" which takes as input an 3 element array and returns the average. Writing the sub is trivial of course and I could call is from other perl scripts using the call
$avg = avg3(@some_array). What I usually do is pool several perl subroutines in the same file say "avg_routines.pl".
Any help or comments welcome. Thanks