Hello Dear Monks

I have this form :

<FORM ACTION="/hs/scripts/test1.pl" METHOD="post" ENCTYPE="multipart/f +orm-data"> Photo to Upload: <INPUT TYPE="file" NAME="pic1"> <br><br> <INPUT TYPE="submit" NAME="Submit" VALUE="Submit Form"> </FORM>

and the script :

#!/usr/bin/perl -w use strict; use warnings; use CGI; use CGI::Carp qw/fatalsToBrowser/; use Storable; my %db; my $query = new CGI; my $dbfile = "C:/Program Files (x86)/Abyss Web Server/htdocs/hs/script +s/db1"; print "Content-type: text/html\n\n"; my $var = $query->param("pic1"); print $var . "<br>"; # my @TMP1 = split ( // , $var); # $var = join ( "" , @TMP1); $db{"1"}{"pic1"} = $var; store \%db, $dbfile ;


which produces

pic.jpg Software error: Can't store GLOB items at ..\..\lib\Storable.pm (autosplit into ..\..\ +lib\auto\Storable\_store.al) line 215, at test1.pl line 25 For help, please send mail to this site's webmaster, giving this error + message and the time and date of the error.


if I uncomment

# my @TMP1 = split ( // , $var); # $var = join ( "" , @TMP1);


it works


But I have no idea why !


Thanks


Have a nice day.


"There is only one good, namely knowledge, and only one evil, namely ignorance." Socrates

In reply to CGI and Storable : explain me this, please. by lepetitalbert

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.