Leser: 1
6 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
use LWP::UserAgent;
use HTTP::Request;
my $url='http://del.icio.us/url/check?url=http://www.testing.invalid';
my $ua = LWP::UserAgent->new();
my $request = HTTP::Request->new(GET => $url);
my $response = $ua->request($request);
print $response->header('Location') , "\n";
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request;
my $url='http://del.icio.us/url/check?url=http://www.testing.invalid';
my $ua = LWP::UserAgent->new( max_redirect => 0 );
my $request = HTTP::Request->new(GET => $url);
my $response = $ua->request($request);
# check the outcome
if ($response->is_success) {
print $response->content;
}
else {
# Testausgabe
#print "Error: " . $response->status_line . "\n";
#print " " . print $response->header('Location') , "\n";
# Umleitung ist z. B. Statuscode 301, 302, 303, 307
my ($retsc) = $response->status_line =~ /^(\d{3})/;
for my $sc (301,302,303,307) {
print 'Umleitung -> ', $response->header('Location'), "\n" if ($retsc == $sc)
}
}
QuoteIf You don't know what it does, why do you put it in your code
1
2
3
print +(a=>b=>c=>d=>e=>f=>g=>h=>i=>j=>k=>l=>m=>n=>o=>p=>q=>r=>s=>t=>u=>v=>w=>x=>y=>z=>" ")
[9=>20=>18=>19=>-1=>0=>13=>14=>19=>7=>4=>17=>-1=>15=>4=>17=>11=>-1=>7=>0=>2=>10=>4=>17];
6 Einträge, 1 Seite |