Richard Heintze wrote:

I'm using these statements in my main program:

use DisplayPCE qw($order $fnx );

...
print join("", map { qq[<td>$_</td>] }
@{$DisplayPCE::order});
...

When I use the debugger, I find that order is
undefined! When I use the browser to view the page,
the value of undef is confirmed.

When I abandon packages and put the definition of
order in the main program, it works!

Can anyone help me understand why my package is not
working?
         Siegfried

Here is the contents DisplayPCE.pm:

package DisplayPCE;
our  @EXPORT = qw($order );
my $order = ["First Name", "Last Name", "E-Mail",
"User Name", "Address", "City", "State", "Zip Code",
"Country", "Phone",  "Org.", "Gender", "Ethnicity",
"Age", "Religious Affiliation" ];

1;


@EXPORT isn't a Perl standard variable, it is just a convention provided by the standard Exporter module. So you will need to let Perl know that your package is an exporter and then it will automatically export what is in @EXPORT, you may want to consider using @EXPORT_OK instead.


package DisplayPCE;
require Exporter;
@ISA = qw( Exporter );

For more information:

perldoc Exporter
perldoc -f import
perldoc perlmod
perldoc -f use

http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to