Click here to get back home

use CGI qw(:standard escapeHTML);

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
use CGI qw(:standard escapeHTML); qwik-silver 01-14-2005
Get Chitika Premium
Posted by qwik-silver on January 14, 2005, 2:54 am
Please log in for more thread options
I'm new to Perl, and I think the following line in my code is causing
problems, use CGI qw(:standard escapeHTML);

I think this is a perl module. Would someone mind explaining what this
line of code is doing and what perl module it is using.

Many Thanks



Posted by Brian McCauley on January 14, 2005, 7:34 pm
Please log in for more thread options
qwik-silver wrote:

> I'm new to Perl, and I think the following line in my code is causing
> problems, use CGI qw(:standard escapeHTML);

What sort of problems?

Please see the posting guidelines for this newsgroup.

> I think this is a perl module. Would someone mind explaining what this
> line of code is doing and what perl module it is using.

You appear to be asking what the Perl command 'use' does.

You can find out by typing:

perldoc -f use

You are right though, it loads modules. In this case it is loading the
CGI module. The CGI module is the most commonly used sensible way to
write a CGI script in Perl. You can find out more about the CGI module thus:

perldoc CGI

The bit after the module name tells 'use' to call the CGI module's
'import' method with the arguments (':standard','escapeHTML').

In principle it's entitely up to the module author how these arguments
are interpreted but in many modules including CGI this has the effect of
instucting the CGI module to make available to your script a set of
functions that have been called the 'standard' set and also the one
extra function escapeHTML. Noter there's nothing special about the name
'standard' it's just a name. There is also a set called 'default' which
is special because it's what you get it you don't pass any arguments to
the module at all via the use satement.

Note: I'm 99% sure you didn't really want an explaination of what use does.



Similar ThreadsPosted
Modules not installing to standard LIB directory November 17, 2005, 8:14 am
How to upgrade perl standard module? August 19, 2005, 10:01 pm
CGI::Simple::Standard and CGI::Alert authors are unresponsive July 28, 2007, 5:58 pm
[RESOLVED] DBD::mysql unresolved symbol _intel_fast_memcpy & mysql-standard-5.0.22-linux-i686-icc-glibc23 August 29, 2006, 6:33 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap