That is a fragment of code that makes no sense in isolation, or at least, can't usefully be run in isolation. Here is a version with very minor changes to make the code look Perlish:
my $tmp_file_name = $_FILES{Filedata}{tmp_name};
my $ok = move_uploaded_file($tmp_file_name, '/path_to/new_filename');
print $ok ? "OK" : "FAIL";
which really doesn't get you any much further ahead I'm guessing because you don't know how the global "hash" %_FILES is populated (in PHP parlance it's an array, but PHP is a very confused language). You don't show the code for the sub move_uploaded_file and that is likely a less trivial conversion.
Added: Oh, and most hosts that provide Perl will also provide PHP. It's unusual not to have PHP available on a web server.
True laziness is hard work
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.