npc has asked for the wisdom of the Perl Monks concerning the following question:
and here is the simple test program:package Foo; use strict; use Data::Dumper; use Exporter; our ($VERSION,@ISA,@EXPORT,@EXPORT_OK); $VERSION = 0.99; @ISA = qw(Exporter); @EXPORT = @EXPORT_OK; @EXPORT_OK = qw(new test); sub new(){ my $self = {}; $self->{data} = {}; $self->{data}->{start_url} = "https://www.w.com/home.html"; bless \$self; } sub test(){ my $self = shift; # print $self->{data}->{start_url}; # print Dumper($self); print Dumper($self->{data}); }
and here is the error: Not a HASH reference at Foo.pm line 26.use strict; use warnings; use Foo; my $obj = Foo->new(); $obj->test();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash "member" of a module
by Corion (Patriarch) on Apr 15, 2009 at 18:06 UTC | |
|
Re: hash "member" of a module
by kennethk (Abbot) on Apr 15, 2009 at 18:07 UTC | |
by npc (Initiate) on Apr 15, 2009 at 18:12 UTC |