In article <bvpdjs$edu$>,
Gerald Jones <> 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.