I posted an inquiry a couple of days ago regarding the behavior of Store_fd. I found out that this wasn't the problem. The thing is that I'm trying to serialize an object and I'm trying to do it with "Storable". I open up a file and when I write into it with store_fd it doesn't do it.
I just found out that somehow a function that I am using is closing the file or redirecting the file descriptor in some manor.
The following is an extract from my code to see if anybody can help me:
local *F;
open (F, ">$file") || die "Error opening $file: $!\n";
my ($id, $obj);
while (($id, $obj) = each %$all_instances) {
my $class = ref($obj);
my @attrs =
$obj->get_attributes(@{$this->
get_attrs_for_class($class)});
### I discovered that after this line of code,
### it either closes the file or redirects the
### file descriptor.
my @array = ($class, $id, @attrs);
Storable::store_fd (\@array, \*F);
}
close(F);
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.