Antgoodlife
2008-12-30 19:40:19 UTC
New to perl and this community...Hi all...
I've done some javascript / proxy pac work and I was curious if perl
has a built in (or if someone can point me to a module) that
determines if an IP is in a specific network? (Similar to proxy.pac
isinnet function)
For example :
#!/usr/bin/perl -w
# if ip 10.8.5.3 is in net 10.8.0.0 w/mask 255.255.0.0 return true
$ipaddr = "10.8.5.3"
print "$ipaddr is in the network!" if isinnet
($ipaddr,"10.8.0.0","255.255.0.0");
CIDR notation acceptance is a plus however not required for my
question.
Thank you in advance.
I've done some javascript / proxy pac work and I was curious if perl
has a built in (or if someone can point me to a module) that
determines if an IP is in a specific network? (Similar to proxy.pac
isinnet function)
For example :
#!/usr/bin/perl -w
# if ip 10.8.5.3 is in net 10.8.0.0 w/mask 255.255.0.0 return true
$ipaddr = "10.8.5.3"
print "$ipaddr is in the network!" if isinnet
($ipaddr,"10.8.0.0","255.255.0.0");
CIDR notation acceptance is a plus however not required for my
question.
Thank you in advance.