tphyahoo has asked for the wisdom of the Perl Monks concerning the following question:
In test.pl, I can make calls to Data::Dumper, a handy thing for dumping data structures like arrays of hashes, hashes of arrays, and so on.
But when I make calls to Data::Dumper inside test.pm, I get undefined function errors.
Can someone please help me get back on the path to perl enlightenment?
The script.....
#test.pl use warnings; use strict; use Data::Dumper; use lib 'E:/data/entwicklungsArena/perl/development/modules'; use Misc::Test ('test_function'); my $test = "Test"; print Dumper($test); #works, prints $VAR1='Test'; test_function; #fails, "undefined subroutine &Misc::Test::Dumper....."
And the module.....
Thanks!#test.pm use strict; use warnings; use Data::Dumper; package Misc::Test; use base 'Exporter'; our @EXPORT_OK = ('test_function'); my $test = "test"; sub test_function { print Dumper($test); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to use Data::Dumper inside a module?
by Tanktalus (Canon) on Feb 11, 2005 at 15:22 UTC | |
by tphyahoo (Vicar) on Feb 11, 2005 at 15:24 UTC | |
|
Re: how to use Data::Dumper inside a module?
by Fletch (Bishop) on Feb 11, 2005 at 15:37 UTC | |
|
Re: how to use Data::Dumper inside a module?
by naChoZ (Curate) on Feb 11, 2005 at 18:54 UTC |