Solved

"<array variable> is not exported by the <module name>" error message

Posted on 2002-06-03
4
241 Views
Last Modified: 2010-05-18
 Hello there, I am very new to Perl (all my experience comes from last weekend trying to get my head around it) and I am developing a hosting cart.

  I have an array variable @cart and a perl module MyCart.pm. In my MyCart.pm module I explicitly export my @cart variable doing:

MyFile.pm
------------------------------------

package MyFile;

use CGI::Cookie;
use Exporter;
$ISA = qw/Exporter/;
$VERSION = 0.9;
@EXPORT_OK = qw/@cart/;

and in another perl file I am importing it by doing:

MyTestCGIFile.pl
----------------------

use MyCart qw/@cart/;


  but everytime I run it from command prompt (from browser I am getting a 500 Internal Server Error) I am getting the following error:

"@cart is not exported by the MyCart module".

  Any ideas of how I can export/import it and what this error message means is greatly appreciated.

  I am using Perl v5.6.1 under Mandrake Linux 8.1.

  Kind regards
0
Comment
Question by:girionis
  • 2
4 Comments
 
LVL 3

Expert Comment

by:DVB
ID: 7053087
Is @cart defined correctly in the MyCart.pm file?
0
 
LVL 35

Author Comment

by:girionis
ID: 7053862
 How should it be declared? COuld you provide some sample code?

  Kind regards
0
 
LVL 35

Author Comment

by:girionis
ID: 7055009
 Problem solved. Instead of use MyCart I did import MyCart qw/@cart/. I seem to obtain the disered result.

  I would like to ask a moderator to refund the points back to me and close the question.

  Kind regards.
0
 

Accepted Solution

by:
ComTech earned 0 total points
ID: 7143786
Question has been solved and placed into PAQ, and points refunded.

Thank you,
ComTech
CS Admin @ EE
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
perl CPAN issue 3 90
perl script to search for files containing text 3 65
Replace  text in a file 2 85
Insert Text into odbc.ini file 15 63
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now