Solved

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

Posted on 2002-06-03
4
247 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sending email via Perl on Windows 3 167
Perl Script - Remove column of data based on column value 2 51
problem with using the glob function 1 71
File Find regex problem 4 62
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…

831 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