rup173 has asked for the wisdom of the Perl Monks concerning the following question:

in Functions use and require which will throw an error on failure to add the semantics?

20041122 Edit by ysth: change title from "error"

Replies are listed 'Best First'.
Re: difference between 'use' and 'require'
by Joost (Canon) on Nov 22, 2004 at 10:05 UTC
Re: difference between 'use' and 'require'
by Arunbear (Prior) on Nov 22, 2004 at 13:36 UTC
    It's easy to test this yourself:
    >perl -e "use Some::Bogus::Package;" Can't locate Some/Bogus/Package.pm in @INC (@INC contains: C:/Perl561/ +Perl/lib C:/Perl561/Perl/site/lib .) BEGIN failed--compilation aborted at -e line 1.
    >perl -e "require Some::Bogus::Package;" Can't locate Some/Bogus/Package.pm in @INC (@INC contains: C:/Perl561/ +Perl/lib C:/Perl561/Perl/site/lib .)