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


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Require vs Use? In reply to
Andy,

You are always so helpful!! Thankyou.

Thanks,
Michael