bichonfrise74 has asked for the wisdom of the Perl Monks concerning the following question:
Nothing is dump at all. I am not sure why. I read somewhere that I should treat variables binded by the tie operator as normal variables. So, normally the above syntax should show me the content of the hash. Any thoughts?print Dumper \%test;
#!/usr/bin/perl use strict; use Data::Dumper; tie( my %test, 'Sample_Tie_Class' ); $test{'hello'} = 'hi'; print "$test{'hello'}\n"; print Dumper \%test; package Sample_Tie_Class; use strict; sub TIEHASH { my $class = shift; bless { 'value' => {}, }, $class; } sub STORE { my ($self, $key, $value) = @_; $self->{'value'}->{$key} = $value; } sub FETCH { my ($self, $key) = @_; return $self->{'value'}->{$key}; } sub FIRSTKEY { }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dumping Tie Objects
by bichonfrise74 (Vicar) on Nov 20, 2009 at 21:42 UTC | |
by AnomalousMonk (Archbishop) on Nov 21, 2009 at 00:15 UTC |