Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Understanding Net::CIDR 0.09 output

Reply
Thread Tools

Understanding Net::CIDR 0.09 output

 
 
Gerald Jones
Guest
Posts: n/a
 
      02-04-2004
Hi,

So this output might be shorthand for something but, I'm a newjack at
networking and I'd like to know if this is a bug (doubtful) or not. I have the
following snippet:

--8<--
#!/usr/bin/perl
use Net::CIDR; # using version 0.09

$cidr = Net::CIDR::range2cidr("1.2.3.0 - 1.2.3.255");
print "$cidr\n"; # outputs: 1.2.3.0/24

$cidr = Net::CIDR::range2cidr("1.2.3.4 - 1.2.3.255");
print "$cidr\n"; # outputs: 6

$cidr = Net::CIDR::range2cidr("1.2.3.4 - 1.5.6.7");
print "$cidr\n"; # outputs: 17
-->8--

So, what does the second two outputs mean? How do I convert it to the form of
the first output line?

Thanks,
Gerald.
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      02-04-2004
Gerald Jones wrote:
> So this output might be shorthand for something ...


Do not multi-post!

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      02-04-2004
In article <bvpdjs$edu$(E-Mail Removed)>,
Gerald Jones <(E-Mail Removed)> wrote:
:So this output might be shorthand for something but, I'm a newjack at
:networking and I'd like to know if this is a bug (doubtful) or not. I have the
:following snippet:

:$cidr = Net::CIDR::range2cidr("1.2.3.0 - 1.2.3.255");
rint "$cidr\n"; # outputs: 1.2.3.0/24

OK.


:$cidr = Net::CIDR::range2cidr("1.2.3.4 - 1.2.3.255");
rint "$cidr\n"; # outputs: 6

Net::CIDR::range2cidr probably wanted to return a list of 6 elements,
but you wanted the result put into a scalar, so perl automagically did
scalar() on the result. scalar() applied to a list returns the number
of elements in the list.


:$cidr = Net::CIDR::range2cidr("1.2.3.4 - 1.5.6.7");
rint "$cidr\n"; # outputs: 17

Same thing.

Try

@cidr = Net::CIDR::range2cidr("1.2.3.4 - 1.5.6.7");
print "@cidr\n";
--
Strange but true: there are entire WWW pages devoted to listing
programs designed to obfuscate HTML.
 
Reply With Quote
 
Gerald Jones
Guest
Posts: n/a
 
      02-04-2004
In comp.lang.perl.misc Gunnar Hjalmarsson <(E-Mail Removed)> wrote:

> Do not multi-post!


Have you ever heard of the Breidbart Index, Gunnar?

<http://www.stopspam.org/usenet/mmf/breidbart.html>

and, Proverbs 17:28?

Even a fool, when he holdeth his peace, is counted wise:
and he that shutteth his lips is esteemed a man of understanding.
 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      02-04-2004
Gerald Jones <(E-Mail Removed)> wrote in news:bvpgsm$fe6$(E-Mail Removed):

> In comp.lang.perl.misc Gunnar Hjalmarsson <(E-Mail Removed)> wrote:
>
>> Do not multi-post!

>
> Have you ever heard of the Breidbart Index, Gunnar?
>
> <http://www.stopspam.org/usenet/mmf/breidbart.html>


If you have a point, I do not get it. Clearly, BI ranks your multipost
higher on the spam scale. That is, according to the criterion that you are
using to counter Gunnar's objection to your spam, you are a spammer. So,
why not apologize and stop doing that?

Sinan.

--
A. Sinan Unur
http://www.velocityreviews.com/forums/(E-Mail Removed) (reverse each component for email address)
 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      02-04-2004
Gerald Jones wrote:
> In comp.lang.perl.misc Gunnar Hjalmarsson <(E-Mail Removed)>
> wrote:
>>
>> Do not multi-post!

>
> Have you ever heard of the Breidbart Index, Gunnar?
>
> <http://www.stopspam.org/usenet/mmf/breidbart.html>
>
> and, Proverbs 17:28?
>
> Even a fool, when he holdeth his peace, is counted wise: and he
> that shutteth his lips is esteemed a man of understanding.


No, I hadn't heard of either.

But I try to apply common sense when posting to newsgroups, and
posting multiple copies of the same help request to different
newsgroups is simply rude. Why? Because it might lead to somebody
making efforts to help you without knowing that you already got the
help you need somewhere else.

Cross-posting, on the other hand, may occationally be motivated.

You may think it's foolish to react when somebody multi-posts. Well, I
disagree, and I'll keep reacting to that rude behaviour. Would guess
that most people who use Usenet regularly would agree with me.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
please help me in understanding the output of the below code Ramesh Javascript 7 04-02-2009 06:04 PM
Help with understanding 'show ip route' output John Smith Cisco 1 09-04-2005 01:15 AM
Understanding java error output - related to the sun app server PE 8.1 gonzalobriceno@gmail.com Java 1 06-07-2005 04:27 PM
Is Fuji S3000 3.2m/pixel output, or 6 m/pixel interpolated output? Peter H Digital Photography 43 12-04-2003 02:35 PM
Output / Debug window output bug? John Bentley ASP .Net 0 09-10-2003 07:38 AM



Advertisments