Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How to create and use external modules with ActiveState Perl 5.8+?
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.



Report this thread to moderator Post Follow-up to this message
Old Post
Siegfried Heintze
12-29-04 08:56 PM


Re: How to create and use external modules with ActiveState Perl 5.8+?
....
>
> our @EXPORT qw($convex_pl);

This is supposed to be a list to array assignment, except that the
assignment operator "=" is missing.  Try:

our @EXPORT = qw($convex_pl);

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

This message tells you there was a syntax error, which means
the code you have is not valid perl.  The line number, and what it says
it is near helps pinpoint the problem.

> Compilation failed in require at test_sample_module.pl line 1.

This message tells you your script couldn't compile because the
module failed to load.

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

This message tells you the BEGIN block failed.  That is because
"use" is shorthand for:

BEGIN { require Module; import Module LIST; }


Hopefully, by carefully examining the error message you can avoid
having to ask.  Perhaps the example had a misprint.

Jonathan Paton

--
#!perl
$J=' 'x25 ;for (qq< 1+10 9+14 5-10 50-9 7+13 2-18 6+13
17+6 02+1 2-10 00+4 00+8 3-13 3+12 01-5 2-10 01+1 03+4
00+4 00+8 1-21 01+1 00+5 01-7 >=~/ \S\S \S\S /gx) {m/(
\d+) (.+) /x,, vec$ J,$p +=$2 ,8,= $c+= +$1} warn $J,,

Report this thread to moderator Post Follow-up to this message
Old Post
Jonathan Paton
12-29-04 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:51 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.