John Ackley wrote:
> Trying to split class C IPs into network and host parts.
> 
> this works but I expected the host part in $2:
> 
>        print "<$bu>\n" if $debug;
>        if( $bu =~ /^((\d+\.){3})(\d+)$/ ) {
>                print "$1 $2 $3\n" if $debug;
>        }
> 
> output:
> <172.19.252.130>
> 172.19.252. 252. 130

172.19.252.130 is not a class C address, RFC 1166 defines it as a class B
address.  Without a netmask (255.255.255.0) or the CIDR notation
(172.19.252.130/24) specifying the network bits the network and local address
parts could be anything.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to