How to create and use external modules with ActiveState Perl 5.8+?

From: Siegfried Heintze (siegfried_at_heintze.com)
Date: 12/29/04


To: <beginners@perl.org>
Date: Wed, 29 Dec 2004 09:26:46 -0700

I'm trying to follow the example Larry Wall's "Programming Perl" book and it
is not working with ActiveState 5.8+.

 

Here is sample.pm:

package sample;

require Exporter;

our @ISA = ("Exporter");

our @EXPORT qw($convex_pl);

$convex_pl = "/cgi-shl/convex.pl";

1;

 

Here is test_sample_module.pl in the same directory:

use sample;

print $convex_pl;

 

 

I get a syntax error:

syntax error at sample.pm line 4, near "@EXPORT qw($convex_pl)"

Compilation failed in require at test_sample_module.pl line 1.

BEGIN failed--compilation aborted at test_sample_module.pl line 1.