- $ua->request($req);
- if (! $ua->success) {
- die("Can't retrieve line information: ", $ua->response->status_line);
- }
-
- print $req->response->content()."\n";
- $g_identity->append_text("\@line1");
- $g_identity->set_active(0);
+ my $response = $ua->request($req);
+
+ my @lines=split("\n", $response->content());
+ foreach (@lines) {
+ chomp;
+ #<option value="1" selected>51@stargate.gernoth.loc</option>
+ #<option value="2">89@asterix.ear-projekt.de</option>
+ #<option value="3">41@grumpy.gernoth.loc</option>
+ if (m/^\<option value=\"(.+)\"( selected)?\>([^<]*)\<\/option\>$/) {
+ $g_identity->append_text("${3}");
+ $g_identity->set_active(${1}-1) if(defined($2));
+ }
+ }