Hello

I am building a web application based on CGI::Application. Also using Plugin::Session to keep session state. In one run mode of the application users are allow to upload a file. I am also saving session state in my post run using:

sub cgiapp_postrun { my $self = shift; #die Dumper($self); $self->session->save_param(); $self->session->flush(); }

my session Driver is file and I believe therefor uses Data::Dumper. Anytime I try to either Dump the session data using Dumper() or hit the pst run I get the following error:

Assertion ((buffer)->sv_flags & 0x00000400) failed: file "sv.c", line +1741 at /usr/lib/perl5/5.10.0/i386-linux-thread-multi/Data/Dumper.pm +line 190

Also if I die $q->param('bulk_upload'); the field is not populated. bulk_upload is the name of my upload field.

Has anyone seen this? I found this http://www.nntp.perl.org/group/perl.perl5.porters/2009/05/msg146341.html but don't know enough to know if this is the same issue.

Thanks in advance,

Cory

UPDATE:

perl 5.10.1 installed, getting same error, but found this post

post

Talks about deleting the FH pointer in the session, I have both

$self->session->clear(['bulk_upload']);and $q->param('bulk_upload','' +); $self->session->clear('bulk_upload');

funny thing is it gets past this the first time, and if I clear the CGI session file,

_SESSION_REMOTE_ADDR' => '10.10.192.63','bulk_file' => bless( \*{'Fh:: +fh000018yy_import.txt'}, 'Fh' ),'_SESSION_CTIME' => 1261427840,'bntsu +bmit' => 'Upload File','_SESSION_ATIME' => 1261427915,'bulk_upload' = +> '','authen_loginbutton' => 'Sign In','Agree' => 'Agree','_SESSION_E +XPIRE_LIST' => {}};;$D[rootvi /var/www/chkdwn/cgi-bin/Sup*/Index.pm

After that I get the following Do not know how to reconstitute blessed object of base type GLOB

UPDATE: PROBLEM SOLVED

on the advice from ikegami and others, of not including the CGI upload FH in the session data. I realized that the CGI param had to be copied to a variable and removed from the CGI param list before the CGI::Session config

Here is what the I had to do in the CGI::Application setup stage.

my $q = $self->query(); $upload_file = $q->param('bulk_file'); $q->param('bulk_file',''); $self->session_config(...

Thanks again to all that helped


In reply to CGI::Application file upload Assertion error with Data::Dumper by gman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.