in reply to Re^2: Storable and passed filehandles
in thread Storable and passed filehandles

In general, passing in \*DB is better than just *DB.

Looking at the docs for Storable I see both ways documented.

However, when reading the source, it looks like using just *DB would get you a fatal "not a ref" thrown, though I don't see you describe the failure beyong "doesn't work" (the universal useless problem description) in your node.

- tye        

  • Comment on Re^3: Storable and passed filehandles (ref to glob)

Replies are listed 'Best First'.
Re^4: Storable and passed filehandles (ref to glob)
by blahblah (Friar) on Aug 15, 2005 at 23:30 UTC
    Doh. Sorry 'bout that. The error I'm getting is:

    Magic number checking on storable file failed at ../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/fd_retrieve.al) line 341, at ./483993.pl line 16

    using the second, much smaller code snippet I posted.

      Quoting the Storable docs:

      At the cost of a slight header overhead, you may store to an already opened file descriptor using the store_fd routine, and retrieve from a file via fd_retrieve.

      So you probably wrote that file with something other than store_fd and so it doesn't contain the "slight header overhead" that fd_retrieve is expecting.

      - tye        

        The giant.db is created by the sysopen. The only thing that ever writes to it is the store_fd.

        Thanks.