WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   Perl Frage (http://www.wcm.at/forum/showthread.php?t=19874)

aticio 24.04.2001 12:03

Hallo zusammen!
Bin Anfänger!!
Kann mir jemand den folgenden code(subroutine) erklären???
Vielen Dank!!

sub get_url {
if ($ENV{'REMOTE_HOST'}) {$remote_ip = $ENV{'REMOTE_HOST'} }
elsif ($ENV{'REMOTE_ADDR'}) {$remote_ip = $ENV{'REMOTE_ADDR'} }
if ($remote_ip =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/) {
$Address = pack('C4',$1,$2,$3,$4);
if ($Address = (gethostbyaddr($Address,2))[0]) {
$remote_url = $Address;
}
}
$remote_url =~ tr[A-Z][a-z];
return ($remote_ip,$remote_url);
}

MZ 24.04.2001 12:12

hm, würde sagen er liest die IP Adresse des Clients und teilt sie dann in die 4 IP Segmente auf

aticio 24.04.2001 12:19

Die beiden Rückgabewerte scheinen immer null zu sein. Woran könnte das liegen????


Alle Zeitangaben in WEZ +2. Es ist jetzt 13:40 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag