rbc has asked for the wisdom of the Perl Monks concerning the following question:
package myPackage; use Exporter; use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 1.00; @ISA = qw(Exporter); @EXPORT = qw( %tables ); @EXPORT_OK = qw(%tables); #%EXPORT_TAGS = (); my $topDir = "E:\\tables"; #### my %tables = ( ABC => { InitDir => "$topDir\\ABC\\", CtlFile => "ABC.ctl", LogFile => "ABC.log" }, XYZ => { InitDir => "$topDir\\XYZ\\", CtlFile => "DOD_CIV_PAY.ctl", LogFile => "DOD_CIV_PAY.log" }, Other => { InitDir => "$topDir\\.", CtlFile => "", LogFile => "" } ); 1;
#!c:\Cygwin\bin\perl.exe -wT use strict; use lib ('.'); use myPackage '%tables'; my $idir = $tables{"ABC"}{"InitDir"}; my $ctlFile = $myPackage::tables{"ABC"}{"CtlFile"}; print "[$idir] [$ctlFile]\n";
$ ./myTest.pl Use of uninitialized value in concatenation (.) or string at ./myTest. +pl line 10 Use of uninitialized value in concatenation (.) or string at ./myTest. +pl line 10 [] []
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Exporting hash?
by Zaxo (Archbishop) on Aug 14, 2002 at 20:53 UTC | |
|
Re: Exporting hash?
by stajich (Chaplain) on Aug 14, 2002 at 20:58 UTC |