So it seems that there is something that EmbPerl is putting into the data
that is going to storable that is a GLOB, code, and other stuff. 
Any ideas Gerald?



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

Here's the contents of status.dat from the epl file:

[root@thinklinux scott-fwhtnfib]# less status.dat
pst0^D^D^D1234^D^D^^L^D^Q^PApache::SessionX^C^O^@^@^@^D^Q 
Apache::Session::Lock::Semaphore^C^F^@^@^<80>^D^@^@^@read^D^Q^NI
PC::Semaph
or<80>^C^@^@^@sem^FJ|^@^@^G^@^@^@sem_ke<80>^@^@^@read_se<
81>^E^@^@^@writ�^E^@^@^@nsems^L^@^@^@lock_manage<81>^E^@^@^
@newid^D
^XYou lost 
CODE(0x83d0228^@^@^@validate^D^Q^\Apache::Session::Store::File^C^B^
@^@^<81>^F^@^@^@opened^D
^XYou lost 
GLOB(0x86d2038)^B^@^@^@fh^L^@^@^@object_store^E^F^@^@^@idfrom^
D
^XYou lost CODE(0x83d23b0)^K^@^@^@unserialize^D^C^L^@^@^@
^Z/www/sessions/DB_File_lock^M^@^@^@LockDirectory
^_Apache::SessionX::Generate::MD^@^@^@Generate
^U/www/sessions/DB_Fil^@^@^@FileNam<81>^K^@^@^@recreate_id
 Apache::Session::Lock::Semaphore^D^@^@^@Lock
^GDB_File^D^@^@^@Inf<81>^E^@^@^@newid
^\Apache::Session::Store::File^E^@^@^@Store
$Apache::Session::Serialize::Storable   
^@^@^@Serializ<81>^D^@^@^@laz<81>^N^@^@^@create_unknown
^M/www/sessions ^@^@^@Directory^D^@^@^@args^D^C^B^@^@^@

2002-03-18^T^@^@^@Survey_Form_Received
 
227672401fee15004fa51578d0d34f7f^K^@^@^@_session_id^D^@^@^@dat<8
A>^F^@^@^@status^D
^XYou lost 
CODE(0x83ca850^@^@^@generate^E^R^@^@^@initial_session_i<82>^D^@^
@^@lock
8^E^D^C^@^@^@^A
 227672401fee15004fa51578d0d34f7f^@^@^@^K_session_id
^@^@^@serialize<81>^I^@^@^@populated^D
^XYou lost CODE(0x81f651c)      ^@^@^@serialize
status.dat (END)

Here's the contents of status.dat from the straight perl script:

[root@thinklinux scott-fwhtnfib]# less status.dat
pst0^D^D^D1234^D^D^^C^A^@^@^@

2002-03-18^T^@^@^@Survey_Form_Received
[root@thinklinux scott-fwhtnfib]#


On 18 Mar 2002 at 17:47, [EMAIL PROTECTED] wrote:

> 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