UNKNOWN =************************************** = Name: IP to Long IP! Check it out! = Description:This is a simple code that will take a make a normal ip a long ip! Long ips are like this one: 3333866552 (type this in the url on your browser if u doubt it works) The code is fully commented so any one with one day of perl coding can understand it. The code also explains how the convertion is done. I hope you like the code, and if u do, plz vote high for it =). If u have any doubt on it, post a comment here, i'll be glad on helping you =). Cya. = By: Bruno Ribeiro = = = Inputs:None = = Returns:None = =Assumes:None = =Side Effects:None =This code is copyrighted and has limited warranties. =Please see http://www.Planet-Source-Code.com/xq/ASP/txtCodeId.174/lngWId.6/qx/vb/scripts/ShowCode.htm =for details. =************************************** #!/usr/bin/perl ################# #Long ips are not very well known and are a nice #alternate to the normal ip #ex: www.linux.org = 198.182.196.56 = 3333866552 #so if u type 3333866552 in your browser u will #be taken to linux.org. #Long ips are usefull for other things too, #like on irc dcc chats #(if u don't know how irc dcc chats work go learn it) #LongIPS can also be used to bypass firewalls that #blocks certain ips. #O well this code is really only to show #how to do long ips #and i also commented every line so #even a complete begginer can #understand this =) #Bye #Bruno Ribeiro ################### print "Ip to LongIP by Bruno Ribeiro\n\nEnter the ip to be made long: "; #gets the user entry for ip $ip = <stdin>; #when reading from stdin it is a nice idea to chomp the var =) #comment the line below and run if u doubt me =) #it will have the same longip as result #but it will insert a line break when u print $ip =) chomp $ip; #this var only exists for u to understand better how to convert an ip to a long ip. $n = 256; #this takes the $ip entered and splits it into the . so #each part of it is stored in the array @sip = split(/\./,$ip); #this calculates the long ip $fip = (@sip[0]*($n * $n * $n))+(@sip[1]*($n * $n))+(@sip[2] * $n) + (@sip[3]); print "The long ip for $ip is: $fip";