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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.