[Nh-pm] Help with Exporter?

Kevin D. Clark kclark at CetaceanNetworks.com
Wed Jan 29 08:35:35 CST 2003


pll at lanminds.com writes:

[...]
> Here's what I have so far:
> 
>     package Foo;
>     use 5.008;
>     use strict;
>     use warnings;
>     use CGI qw/:all/;
> 
>     require Exporter;
> 
>     our @ISA = qw(Exporter);
> 
>     our %EXPORT_TAGS = \
>       ('all'=> [qw(&print_header_table $TEXT $BGCOLOR $LINK $VLINK $ALINK)]);

I think that you want to get rid of that backslash (two lines above).

>     our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
> 
>     our @EXPORT = qw(print_header_table $TEXT $BGCOLOR $LINK $VLINK $ALINK);
> 
>     our $VERSION = '0.02';
> 
>     # WWW vars
>     my ($TEXT)	= "#FFFFBB";
>     my ($BGCOLOR)	= "#000000";
>     my ($LINK)	= "#FFFFBB";
>     my ($VLINK)	= "#00bbff";
>     my ($ALINK)	= "#FF0000";

Use "our" instead of "my" here.

>     sub print_header_table {
> 
>     # a bunch of working code
> 
>     }   

Regards,

--kevin
-- 
Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA)
cetaceannetworks.com!kclark (GnuPG ID: B280F24E)
alumni.unh.edu!kdc




More information about the Nh-pm mailing list