• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Perl [Perl] Funcion getmyip()

Status
Not open for further replies.

Doddy

Leech
User
Joined
Apr 1, 2012
Messages
169
Reputation
0
Reaction score
406
Points
63
Credits
0
‎13 Years of Service‎
57%
Hola a todos.

Aca les dejo una funcion que hice para reconocer nuestra IP sin necesidad de usar paginas webs con ese molesto servicio online.

El codigo :

Code:
>
#By Doddy H
use IO::Socket;

sub get_ip {
my $get = gethostbyname("");
return inet_ntoa($get);
}
Ejemplo de uso

Code:
>
print get_ip();
 
Status
Not open for further replies.
Back
Top