Gossamer Forum
Home : General : Perl Programming :

Require vs Use?

Quote Reply
Require vs Use?
use strict;
require ("/private/lib/Community.pm");
#use private::lib::Community qw/
# comm_init
# comm_config
# comm_auth
# comm_login_url
#/;

use lib '/htdocs/www/cgi-bin/classifiedsDev/admin';
Links::init('/htdocs/www/cgi-bin/classifiedsDev/admin');
use Links qw/$IN $DB $CFG/;
use GT::Base;
use CGI::Carp qw(fatalsToBrowser);
use GT::Dumper;
use GT::CGI;
use Links::Build;
use GT::Template;
use Links::SiteHTML;


I'm curious if an how I can use "use" instead of require to include the community module.

If I type in just

use Community

I get an error.

If I must use require, is there any equivalent to with require to just load in the subs that you need?

#use private::lib::Community qw/
# comm_init
# comm_config
# comm_auth
# comm_login_url
#/;

Thanks,
Mike
Quote Reply
Re: [Swaylock] Require vs Use? In reply to
Hi,

For Community, you need to point the "lib" to something like;

use lib '/path/to/private/folder/lib';

...which is then added as a "reference" for the Perl libraries, including GComm.

Hope that helps.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Require vs Use? In reply to
Andy,

You are always so helpful!! Thankyou.

Thanks,
Michael