in reply to Posting a file from command line

You can use WWW::Mechanize.

According to the docs, you should be able to just get() the upload form, fill in the input value() (i.e. the file's path) and submit().