The shortened code is below..$hash{keylvl1}{keylvl2}
When I do this several assignments I get FETCHE's instead of STORE:package Tie::HashDF; use strict; BEGIN { require Exporter; require Tie::Hash; @Tie::HashDF::ISA = qw(Exporter Tie::StdHash); @Tie::HashDF::EXPORT = qw(); } sub tolog { print "$_[0] : $_[1]\n"} sub TIEHASH { my $self = bless {}, shift; return $self } sub FETCH { tolog 'FETCH', "$_[1] : $_[0]{$_[1]}"; $_[0]{$_[1]} } sub STORE { tolog 'STORE'; } 1;
-----#!/usr/bin/perl use strict; use lib '/work/lib'; use Tie::HashDF; my $obj = tie my %hash, 'Tie::HashDF'; #my $a = $hash{toby}{ip}; $hash{toby}{ip} = '111'; $hash{drago}{account} = 'halo'; #undef $obj; #untie %hash;
Could this be problem 'cause it is not onlevel-hash.. When I write this hash to disk all changes I have made are seen. i.e. it works as expected from me, but instead of triggering STORE it triggers FETCH..FETCH : toby : HASH(0x821a9a0) FETCH : drago : HASH(0x81433fc)
what I'm doing wrong ?FETCH : toby : HASH(0x821a9dc) FETCH : toby : HASH(0x821a9dc) FETCH : drago : HASH(0x8143520)
In reply to tieing HoH by bugsbunny
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |