[NTLUG:Discuss] Direction Recomendations AND netmasks
Kyle_Davenport@compusa.com
Kyle_Davenport at compusa.com
Thu Jul 20 10:19:50 CDT 2000
Here, Here! I've been programming with a dozen different languages for over 2
decades now, and I am quite fond of perl. It has an inner beauty (which perhaps
only a linguist can appreciate).
As an example, since we were discussing net masks, I wrote this obscure but
concise algorithm:
# Put your list of subnets in @nets:
@nets = ("9.238.8.0/24","172.16.64.0/18","192.168.1.0/24");
# Convert @nets to searchable subnets and netmasks:
foreach (@nets) {
($snet,$lmask) = split /\//;
@mask = (0,0,0,0);
foreach $octet (0,1,2,3) {
$shift = 7;
for ( $bit = $lmask < 8 ? $lmask : 8 ; $bit > 0 ; $bit -= 1) {
$mask[$octet] += 1 << $shift--;
}
$lmask -= 8
}
@netmask = (@netmask,"$mask[0].$mask[1].$mask[2].$mask[3]");
@subnet = (@subnet,"$snet");
}
MadHat <madhat at unspecific.com> on 07/20/2000 09:48:19 AM
Please respond to discuss at ntlug.org
To: discuss at ntlug.org
cc: (bcc: Kyle Davenport/Is/Corporate/CompUSA)
Subject: Re: [NTLUG:Discuss] Direction Recomendations
Richard Cobbe wrote:
>
> Lo, on Thursday, 20 July, 2000, Steve Baker did write:
>
> >
> > Language wars tend to get very heated and passionate...tread with care!
>
> Truly.
>
<SNIP>
>
> (Note that neither Perl nor Java are in that list. Java is, at best, a
> mid-level language. True, it's higher-level than C++, but that's rather
> damning with faint praise. Perl, as Steve said above, is just a mess.
> Avoid it wherever possible.)
Please...
It is easier to avoid 'Language wars' if you don't spout bad things
about languages (that apear to be based in personal opinion, but are
presented as fact). Perl is a great language. There is nothing wrong
with it, and just because you choose to not like it does not mean that
it is a mess or bad.
(snip again)
More information about the Discuss
mailing list