in reply to Can a POST command (with a file attachment) be simulated via the terminal?

Is your Perl script (1) listening to the network, or is it (2) a CGI script called by Apache?

(1) What Library are you using to listen to the network, or are you using Socket directly?
Or (2) What CGI library are you using, or did you just code it all yourself?

(1) You can easily use netcat in server mode (or ksh has a built in web server, afaik) or roll a quick server in perl to feed your script the test data
or (2) you need to use set REQUEST_METHOD=GET and set "QUERY_STRING=userid=1234&username=testuser* You may also need set HTTP_COOKIE=sessid=sess_1; then your script will think the web server is feeding it the data.

*Note that on windows, you dont' want to close the ". cmd.exe is easily confused and will usually append it to your variable, causing annoying bugs