I want to get last of redirect URL.
like
url_1 : http://on.fb.me/4VGeu url_2 : https://www.facebook.com/
I want to get url_2 by url_1 in perl. Previous source is below.
sub get_redirect_location
{
my ($url) = @_;
my $ua = LWP::UserAgent->new;
$ua->proxy('http', 'SAMPLE_PROXY');
my $req = new HTTP::Request(GET => $url);
my $res = $ua->request($req);
return $res->headers_as_string;
}
Thanks in advance.