Net::Netmask -> match usage problems
- From: ebresie@xxxxxxx
- Date: 14 Apr 2005 09:03:30 -0700
Hey guys...I am having some problems which may be a newbie type of
questions but i figured I would ask...
I am using the Net::Netmask module to work with a subnet and try to
identify if a given ip is part of that subnet.
Taking some from
http://www.cpan.org/modules/by-module/Net/Net-Netmask-1.9007.readme
We have an $subnetIp, and a box $IP. We created a
$subnetIp = "148.1.2.0";
$IP = "148.1.2.3";
$net = new Net::Netmask($subnetIp);
$result = $net->match($IP);
$result += 0;
if ( $result ) {
# Part of the Subnet
} else {
# Not Part of the Subnet
}
Now for some reason, it always returns 0 or false which causes it to
always to run the not part of the subnet code.
What am I doing wrong?
Eric
.
- Follow-Ups:
- Re: Net::Netmask -> match usage problems
- From: Arjen Laarhoven
- Re: Net::Netmask -> match usage problems
- Prev by Date: Re: Need help with a simple UNIX sockets server based on IO::Socket::UNIX
- Next by Date: Re: Net::Netmask -> match usage problems
- Previous by thread: Need help with a simple UNIX sockets server based on IO::Socket::UNIX
- Next by thread: Re: Net::Netmask -> match usage problems
- Index(es):
Relevant Pages
|
|