what do you want to get?
do you get the size of the network? if yes from there you can make your own fonction to build the netmask.






From: Marija Silajev <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Net::Netmask problem
Date: Mon, 25 Nov 2002 13:16:35 +0100

Hi,

I have the following problem:

I am extracting the CIDR information with the help of 'whois'. Then I want to use Net::Netmask and work further with network blocks but after invoking

print $block->desc();

I get the following:


could not parse 125.60.0.0/16

Use of uninitialized value in pack at /usr/lib/perl5/site_perl/5.6.1/Net/Netmask.pm line 212, <> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/5.6.1/Net/Netmask.pm line 136, <> line 1.
0.0.0.0/


Here is the following code:


my @test=`whois $ip_address`; #get whois information

if ( grep /CIDR:|route/, @test ) {

my @net = grep{ $_ =~ /CIDR:|route/;} @test;
$_ = "@net";
s/CIDR:|route:/ /;
s/^\s+//;

$cidr=($_);

$block = new Net::Netmask($cidr);
print $block->desc();
}


Do you have any suggestions what might be the problem?


Thanks,
Marija


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to