On 9/15/11 Thu  Sep 15, 2011  11:58 AM, "Rajeev Prasad" <rp.ne...@yahoo.com>
scribbled:

> Based on earlier suggestion by list-members, I think the best way to run a
> script inside a script is to turn the inner script into a module of
> subroutines.
>  
> I have few questions:
>  
> given a sample script style:
> ______________________________________________________________
> #!/usr/bin/perl -w
> use strict;
> use Getopt::Long;
> use Net::Telnet;
> 
> ....i declare global variables mostly (i remember fish's suggestion on not
> using, i am reading the best practices page, but too much work...)
> ... i name most of my temporary global variables the SAME in different
> scripts.
> ...has some subroutines of its own.
>  
> scripts will mostly be writing to a file or files
> printing names of files written.
> end_of_script.
> ______________________________________________________________
>  
> how would i turn this into a module which can be called from another script?
> what type of code should be where? (like perl
> interpretor/variables/subroutines inside called subroutine)...

Read 'perldoc perlmod', but maybe skip down to the section labeled "Perl
Modules".

Then, read the whole thing and also these:

perltoot
perlboot
perlmodstyle



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to