--- David Gilden <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I have moved my subroutines to a second file
> and have named it "subs_lib.pl"
> 
> In the main file I have:
> 
> require "subs_lib.pl";
> 
> Is the following equivalent:
> 
> use "subs_lib.pl";

No. The argument to use must be a bareword.
c.f. perldoc -f use

> -----
> 
> Secondly do I need:
> 
> #!/usr/bin/perl
> 
> as the first line in my "subs_lib.pl"

I don't think so -- they are pulled into the same namespace, so it'll
use the main program's shebang. If you put a shebang, I'd expect it to
ignore it as a comment.
 
> and are Libraries really modules with .pl instead of .pm?

Not necessarily. On the one hand, you could require a .pm, while a use
statement pretty much requires .pm, doesn't it?
 
Also, modules tend to expect their own namespace.
require'd files are just parsed like an eval(), so though they *can*
switch namespaces, they often don't.

Somebody give me a reality check on that one?

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Reply via email to