Archive for the ‘Perl’ Category

Perl. HTTP-request from specified IP

October 2nd, 2009 2 comments

For libwww-perl-5.834.

Use the method local_address of LWP::UserAgent object

my $ua = LWP::UserAgent->new( );
$ua->local_address( '' )

For older versions.

Before creating an LWP::UserAgent object you should add following code:

LocalHost => ''

there is the required interface IP address.

Categories: Perl Tags: ,