use strict; use warnings; use Getopt::Std; use LWP::UserAgent; our($opt_p); getopt('p'); my $agent = LWP::UserAgent->new(); ($opt_p == 1 ? $agent->env_proxy() : $agent->proxy(http => $opt_p)) if (defined($opt_p));