#!/usr/bin/perl -w use strict; use WWW::Mechanize; use Getopt::Long; my %CONF = ( lang => 'Plain Text', nick => 'A. Nonyme', desc => '', cvt_tabs => 'No', text => '', ); GetOptions( \%CONF, "lang=s", "nick=s", "desc=s", "cvt_tabs|tabs=i", "text=s" ) or die "Bad options"; my $m = WWW::Mechanize->new; $m->get("http://rafb.net/paste/"); die $m->res->status_line unless $m->success; unless( $CONF{text} ) { $CONF{desc} ||= $ARGV[0]; $CONF{text} = join "", <>; } $m->set_fields( %CONF ); $m->submit; die $m->res->status_line unless $m->success; print $m->response->request->uri->as_string, $/;