Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by tye (Sage)
on Aug 15, 2005 at 23:27 UTC ( [id://484023]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://484023]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-19 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found