I guess one could attack the problem using binary shifts (>>) and bitwise and's as well.sub dotless_to_ip { #use integer; my $dotless = shift; my $index = 3; my @ip = (); while ( @ip < 4 ) { my $temp = 256 ** $index--; push @ip, int($dotless / $temp) ; $dotless -= $ip[ -1 ] * $temp; } return join '.', @ip; }
In reply to Re: Re: Dotless IP address problem
by guha
in thread Dotless IP address problem
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |