On Jul 16, 2004, at 7:54 AM, Luis Pachas wrote:

Hi I have a problem,

I have a PM

i have this
A.pm :

package A;

my %b;

$b = {
   apple => \&foo1,
   oranges => \&foo2,
   open => \&foo3
};

sub foo1 {
  print "apples\n"
}

sub foo2 {
  print "oranges\n"
}

sub foo3 {
  my ($item) = @_;
  print $item."\n"
}

1;

## End Module

MAIN :

!#/bin/perl

lib "$ENV/";
use MOD::A;

$MOD::A::b{foo1}->();
$MOD::A::b{foo2}->();
$MOD::A::b{foo3}->("pairs");

exit();


Thats it, I keep getting a function undefined, I used require and exporter but I kept getting subruotine undefined...at times in the main:: and in the perl modules... I went around this by having the Hash of symbolic references in the main namespace so it works...I just need to know if PERL allows symbolic reference variables or hashs with symbolic references to be access in the Perl modules or just in the main.....

You're using a boat load of tricks to bypass the real problem. Why don't you show us the code that is producing the "function undefined" errors and let us fix that for you.


James


-- 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