ikkeniet has asked for the wisdom of the Perl Monks concerning the following question:
This is probably a stupid beginners question but one has to begin somewhere...
I have a perl file that contains a whole bunch of subroutines. I have a set of different perl scripts that would reuse the subroutines so that I do not have to copy paste the routines all the time.
An important question I have regarding this is that when above is possible, are the variables then known in the load shared library.
Example:
mainscript.pl
routines.pl contains
I have a perl file that contains a whole bunch of subroutines. I have a set of different perl scripts that would reuse the subroutines so that I do not have to copy paste the routines all the time.
An important question I have regarding this is that when above is possible, are the variables then known in the load shared library.
Example:
mainscript.pl
$hello="hello123"; &hello;
routines.pl contains
sub hello { print $hello; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Include subs from different perl file
by Ovid (Cardinal) on Jun 06, 2007 at 08:58 UTC | |
Re: Include subs from different perl file
by almut (Canon) on Jun 06, 2007 at 09:34 UTC | |
Re: Include subs from different perl file
by Moron (Curate) on Jun 06, 2007 at 09:23 UTC | |
Re: Include subs from different perl file
by TGI (Parson) on Jun 06, 2007 at 19:39 UTC | |
by Anonymous Monk on Mar 13, 2013 at 18:27 UTC | |
Re: Include subs from different perl file
by perllove (Beadle) on Jun 07, 2007 at 04:24 UTC |
Back to
Seekers of Perl Wisdom