hi man,
actually let me try to explain what i'm doing here:
#------------------------------------------------------ # Handle all POST, GET, multipart, and upload requests #------------------------------------------------------ my $r = Apache->request(); my $apr = Apache::Request->new($r); my @keys = $apr->param; foreach (@keys) { my @value = $apr->param($_); next unless scalar @value; if (@value>1){ $params{$_} = \@value; } else { $params{$_} = $value[0]; } } my $upload = $apr->upload; if ($upload) { $params{'import_file'} = $upload; }
this is the default method for uploading files using modcgi page via apache. but my problem is that i'm trying to upload files directly from the server bypassing this uploading modcgi page.
unfortunately, most of the functions in my company uses hash{param} method to store parameters, so the file handler and the file name is actually kept using this method. so i need to find a way to put in the file name and the file handle parameter to the $$rhash_params variable so i can minimize changes to the functions that i'm using.
thanks for your answer, i try your method and using the ->filename i got this error:
error Can't modify non-lvalue subroutine call at /script.pm line 1467.\n
and using the {}{} method i got this error msg:
error Not a HASH reference at /media/www/vprimary/script.pm line 1468.\n
from using data dumper this is what i've got:
$VAR1 = { 'file_handler' => bless( \*Apache::Upload::_GEN_2410, 'Apach +e::Upload' ), 'import_file' => bless( do{\(my $o = 447703164)}, 'Apache::U +pload' ), };
any idea how do i put values into the import file or file handler?
thanks & sorry for the belated reply.
~perlnoobian

In reply to Re^2: how to put values into $$rhash_params{'import_file'}->filename? by MelaOS
in thread how to put values into $$rhash_params{'import_file'}->filename? by MelaOS

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.