develooper Front page | perl.beginners | Postings from January 2004

Re: Use and Require

Thread Previous | Thread Next
From:
wolf blaum
Date:
January 29, 2004 15:02
Subject:
Re: Use and Require
Message ID:
200401292040.45478.wolf.blaum@charite.de
For Quality purpouses, Mallik 's mail on Thursday 29 January 2004 18:57 may 
have been monitored or recorded as:

> Dear Perl Gurus,

that must be someone else

>
> What is the difference between Use and Require.
>


try perldoc -f use on your box (or www.perldoc.com):

use Module VERSION LIST
       use Module VERSION
       use Module LIST
       use Module
       use VERSION
               Imports some semantics into the current package
               from the named module, generally by aliasing cer-
               tain subroutine or variable names into your pack-
               age.  It is exactly equivalent to

                   BEGIN { require Module; import Module LIST; }

               except that Module must be a bareword.

               VERSION may be either a numeric argument such as
               5.006, which will be compared to $], or a literal
               of the form v5.6.1, which will be compared to $^V
               (aka $PERL_VERSION.  A fatal error is produced if
               VERSION is greater than the version of the current
               Perl interpreter; Perl will not attempt to parse
               the rest of the file.  Compare with "require",
               which can do a similar check at run time.

There is tons more infomation of how use/require are simliar/different.

Enjoy. Wolf




Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About