Even though the man page states that a meaningless string is stored, we
haven't found that "real" data (numbers, strings, hashes) are getting lost.
Try setting the forgive_me and test to make sure your data is coming back
correctly.

 -----Original Message-----
From:   Scott Chapman [mailto:[EMAIL PROTECTED]] 
Sent:   Monday, March 18, 2002 5:27 PM
To:     Cross, Patrick
Cc:     [EMAIL PROTECTED]
Subject:        RE: Storable not working under Embperl?

I think something deeper is going on here but don't know how to find  it.  I

made some test scenarios and found that I can execute this perl script at
the 
command line just fine:

#!/usr/bin/perl
use Storable;
use Date::Format;
# Retrieve status snapshot data. Update it and put it back.
if (-e 'status.dat') {
  my ($hashref) = retrieve('status.dat') || die "Can't retrieve status data.
$!";
  %sdat = %$hashref;
}
my ($timestamp) = time2str('%Y-%m-%d',time());
$sdat{Survey_Form_Received} = "$timestamp";
store \%sdat, 'status.dat' || die ("Can't store data to status storable.
$!");

The same stuff under Epl: (entire file showing)

[-
use Storable;
use Date::Format; 
# Retrieve status snapshot data. Update it and put it back.
if (-e 'status.dat') {
  my ($hashref) = retrieve('status.dat') || die "Can't retrieve status data.
$!";
  %sdat = %$hashref;
}
my ($timestamp) = time2str('%Y-%m-%d',time());
$sdat{Survey_Form_Received} = "$timestamp";
store \%sdat, 'status.dat' || die ("Can't store data to status storable.
$!");
-]

gives me this:

Logfile
Internal Server Error
The server encountered an internal error or misconfiguration and was unable 
to complete your request.
Please contact the server administrator, [EMAIL PROTECTED] and inform

them of the time the error occurred, and anything you might have done that 
may have caused the error.


[14143]ERR: 24: Error in Perl code: Can't store CODE items at 
blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/_store.al) line
199, at 
/www/htdocs/reviews/scott-fwhtnfib/test2.epl line 11

Apache/1.3.23 (Unix) mod_perl/1.26 HTML::Embperl 2.0b5 [Mon Mar 18 
14:41:33 2002]

Forgive_me may result in garbage in my Store file according to the man page:

> The store functions will `croak' if they run into such references
> unless you set `$Storable::forgive_me' to some `TRUE' value. In that
> case, the fatal message is turned in a warning and some meaningless
> string is stored instead.

I need this to work!  Is there any other avenues for me to explore on this?
I 
haven't tried Data::Dumper yet but I don't see how this can be related to
the 
data I'm storing.  It's the same in both places.

Scott


On 15 Mar 2002 at 16:45, [EMAIL PROTECTED] wrote:

> You can also set $Storable::forgive_me=1; and you'll still get the warning
> but no error.
> 
> We found that if we used function references in some places this would pop
> up.
> 
> 
>  -----Original Message-----
> From:         Gerald Richter [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, March 15, 2002 8:49 AM
> To:   Scott Chapman; [EMAIL PROTECTED]
> Subject:      Re: Storable not working under Embperl?
> 
> 
> > I get this error when trying to store something using Storable and this
is
> > working fine elsewhere in my code.  I'm not storing any CODE items that
> I'm
> > aware of!
> >
> > [849]ERR: 24: Error in Perl code: Can't store CODE items at
> > blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/_store.al)
> line 199, at
> > /www/htdocs/reviews/scott-zgxvrzcx/quest1.epl line 81
> > Apache/1.3.23 (Unix) mod_perl/1.26 HTML::Embperl 2.0b5
> >
> 
> Storable should be useable in EMbperl as in any other Perl code. I would
try
> to store simple test data (not %fdat) and see if you get the same error.
If
> not try a to output %fdat via Data::DUmper before you store and and see
what
> may cause the problem
> 
> Gerald

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to