PERL coredumps with tie but not tied 
Author Message
 PERL coredumps with tie but not tied

        Hmm... probably needs a better subject.

        I'm inheriting from a module that's implementing a hash tie and it
works quite wonderfully.  If I create a new instance of my module (or
just use the value returned from tie or tied), then I can call FETCH and
STORE and all the rest and it all works wonderfully.  If I use the tied
hash however, it gets a bus error and dumps core.  I'm using perl -w and
use strict (of course).

my(%assoc);
my($obj) = tie %assoc, 'MyDir::MyClass';

These work all day long:
$obj->FETCH($key);
$obj->STORE($key,$value);

But these will crash:
$assoc{$key};
$assoc{$key} = $value;

        The value returned by the first tie is another tie, but even if it's
just a string, it still crashes.  In fact, even if I remove everything
and only overload the FETCH it crashes (if I overload nothing, it
works).  I know we can inherit from tie classes, because that's what
Tie::Hash and Tie::StdHash are for, right?  Besides, if I use it in an
OO way instead of as a tie it works perfectly.
        The only thing my subclass does is change the keys using Date::Manip.
So I wondered if there was some rule against doing that, but I couldn't
see anyway that would be important and I've never read anything like
that.
        Maybe one of the gurus can explain this while I'm having lunch. :-)  If
you need more info, feel free to ask.  I don't know that it's important,
but I'm inheriting from AsciiDB::TagFile and it's for a
scheduling/calendar type object (hence the use of Date::Manip).

--
        James L. Gordon



Fri, 14 Sep 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. PERL coredumps with tie but not tied

2. PERL coredumps as tie but not as object

3. BETA TEST: Tk::Tie::MenuHash - Ties a Tk::Menubutton widget to a hash, kinda

4. Proposal... Tie::RangeHash or Tie::Range

5. bizarre(?) problem, tied hash of tied hashes

6. Tie/bless vs. bless/tie and segmentation fault

7. BETA TEST: Tk::Tie::MenuHash - Ties a Tk::Menubutton widget to a hash, kinda

8. Tie::Hash EXISTS not implemented?

9. tie with open2 worked on 5.005 but not 5.6

10. Tied hash not scaling - advice?

11. IPC::Shareable not sharing tied hashes

12. IPC::Shareable not sharing tied hashes

 

 
Powered by phpBB® Forum Software