Solved

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

Posted on 2002-06-03
4
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…

726 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