On Friday 18 June 2004 09:57, Randy W. Sims wrote:
> Joseph Paish wrote:

-- a bunch of stuff deleted

> > i am using packages to break up a large piece of code into smaller pieces

>
> I'm not sure what you're trying to accomplish. If you are going to have
> no subroutines or variables defined for other packages to use, then what
> you're referring to is really a subscript(?). If that's the case you
> don't need a package declaration, and instead of require
> 'path/to/script.pl' you should use do 'path/to/script.pl'
>
> However, you can have free code in a module. You would construct it in
> the same way as your second example, but leave out the reference to
> 'PackageName ;'
>
> C<use> and C<require> basically invoke C<do> as part of their
> functionality. See `perldoc -f require` and `perldoc -f use` for example
> psuedo-code.
>
> Randy.

thanks.

i didn't even know about the existence of "do".  after reading up on it, i 
think that it does exactly what i need done (writing standalone pieces of 
code that i will later call from a "master" program).  

this simplifies things a lot.

joe

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to