Recall that each module has a default list of functions and variables to import. Some modules import many functions by default, others import none. Most import some.
Modules that have a lot of functions and variables to import frequently put them into groups. Groups can be specified using the ":group" syntax.
For example, the CGI::Pretty module has a group called ":standard", which imports a bunch of standard functions for creating HTML pages.
#!/usr/bin/perl
# file: html.pl
use strict;
use CGI::Pretty qw(:standard);
print h1('This is a level one header');
print p('This is a paragraph.');
print p('Here is some',i('italicized'),'text.'); |
% html.pl <h1> This is a level one header </h1> <p> This is a paragraph. </p> <p> Here is some <i>italicized</i> text. </p>
The module's documentation will tell you what function groups are defined. To import the default functions, plus optional ones, use the group ":DEFAULT".
use CGI::Pretty qw(:DEFAULT :standard start_html); |
|
| Contents |
Next |