Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: help on this code below

by aaron_baugher (Curate)
on Oct 27, 2011 at 19:26 UTC ( [id://934219]=note: print w/replies, xml ) Need Help??


in reply to Re^2: help on this code below
in thread help on this code below

A few observations:

The first line loops through the CGI parameter keys (assuming $query is a valid CGI.pm object or something similar). They're sorted numerically, which is odd, and possibly pointless.

The next line skips to the next key if this one is empty of anything but whitespace -- unlikely, and superseded two lines later by a more specific check.

The next line skips to the next key if this one's value is empty of anything but whitespace.

The next line skips to the next key if this one doesn't start with "filetoupload_" followed by one or more digits. If it does match that pattern, the digits are put in $Number by the next line and the loop proceeds on.

Then after a blank line, your 'if' line checks the value of this filetoupload_\d+ parameter, and if it doesn't end in a forward or backward slash, puts everything after the last slash in $1, which the next line puts into $Filename.

The next line puts $2 into $pxuser. But since there is only one set of capturing parentheses in the last regex, $2 will always be empty at this point, and thus so will be $pxuser. This is probably a problem.

You also talk about getting a "p_usr" value, as well as a "pusr" value, but your code doesn't do this, and these are also not interchangeable. Where do you expect "the user who has triggered the upload" value to come from? Are "pxuser", "p_usr", and "pusr" three different things, or the same thing inconsistently typed?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://934219]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-23 06:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found