newbie_77 has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to use store_fd to serialize an object. The thing is that I open up the file and when I store, it doesn't write anything into the file. I'll post my code to see if anybody can help me:
open (F, ">$file"); ###Here I open the file for writing Storable::store_fd [$class, $id, @attrs], \*F; ###Here I'm trying to store an anonymous ###array into my opened file but it doesn't ###work.
Please help me!!! Thanks for your time.

Replies are listed 'Best First'.
Re: NEED HELP FAST WITH Store_fd
by chromatic (Archbishop) on Jun 28, 2000 at 19:47 UTC
    It works for me. However, you need to check the results of the open call:
    { local *F; # for safety open (F, ">$file") || die "Can't open $file: $!"; Storeable::store_fd [$class, $id, @attrs], \*F; # or just *F wo +rks close F; }
    The die is the important part. If you can't open the file, store_fd won't do anything.
RE: NEED HELP FAST WITH Store_fd
by merlyn (Sage) on Jun 28, 2000 at 22:40 UTC