Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Jason Carlton
November 29, 2009, 1:57 am
rate this thread
I'm have several scripts that share the same function, so I'm moving
that function to a separate script and using require in the parent
This function uses the CGI::Cookie module. Do I need to "use" this
module in each of the parent scripts, or can I only call it once in
the required script?
Re: Modules in a required file
Consider making a proper module instead. It has several advantages.
CGI::Cookie appears to be an OO module, so you need only 'require' or
'use' it once before you attempt to create your first object. For
modules that export functions, you need to 'use' them once per package,
so if your required file uses the same package as the file requiring it
a single 'use' will suffice. Modules that have lexical effect, like
'strict' and 'warnings', need to be used separately in every scope they
need to apply to, so don't forget the 'use warnings; use strict;' in the
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum