in reply to Re^3: Storable and passed filehandles (ref to glob)
in thread Storable and passed filehandles

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.
  • Comment on Re^4: Storable and passed filehandles (ref to glob)

Replies are listed 'Best First'.
Re^5: Storable and passed filehandles (ref to glob)
by tye (Sage) on Aug 16, 2005 at 00:40 UTC

    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.

        Then you are trying to retrieve from an empty file, which fails so nothing ever gets stored to it.

        - tye