Re: Translate small Perl to equivalent VB6?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: WinGuy (no_spam_at_nomail.bot)
Date: 09/26/04


Date: Sun, 26 Sep 2004 21:13:32 GMT


"Larry Serflaten" <serflaten@usinternet.com> wrote in message
news:eG445R$oEHA.1300@TK2MSFTNGP12.phx.gbl...
>
> "WinGuy" <no_spam@nomail.bot> wrote
> > There's another thread going here about how to convert a range of IP
> > addresses to a list of CIDR equivalents. (I'm not following the results
> > there very well, the code given there, so far, is way above my
understanding
> > about what is actually going on and uses some functionality of VB I'm
just
> > not experienced with). I found a really short program listing written in
> > Perl that is supposed to generate CIDR lists for ranges of IP addresses.
Can
> > anyone fully translate it to VB6 format for me so I can see how that
author
> > does it? It's at:
> >
http://ftp.iasi.roedu.net/mirrors/ftp.ripe.net/stats/issued/range2cidr.pl
>
>
> I already did that.
>
> Plagurizing Bob's code, and plugging in my own response would give you
> a working example. Add 2 textboxes and a command button to a new form
> and paste in the code below:
>
> The code below assumes you are either using VB6, or have copies of the
> VB6 Split and Join functions (See Randy's site if you need those)
>
> HTH
> LFS

Hi, Larry

I already have the IPRange2Cider utility that mscir kindly pointed me at,
and it has solved my immediate need. What I'm after is a true understanding
of some of the basic things going on in the code Bob wrote, and networking
in general, and right now there's many things I don't understand - both in
functionalities I've never used before (split was new to me) as well as from
the "why do it that way" perspective. I'm trying to learn, not plagurize
(although I'm sure it's not just me that truly appreciates the public
contribution!) I thought if I had a fairly exact and full translation of
the Perl code then that might help me understand some basics. I really don't
want to pester Bob with what I'm sure he'd think are dense questions from
me. He already has said he's a buy fellow. Besides, that other topic really
developed into a "development with code" topic, so I started this one more
for the purpose of trying to understand the what's & why's, using what looks
to be a very short Perl listing that I imagine would transfer into an
equally short VB listing, and then I could compare the 2 (and learn a little
Perl in the process, too!)

Thanks for adding the interface! I've tried it at this writing and it gave
the same and rather long list of results as does the IPRange2CIDR utility
for a range from 217.224.0.5 to 217.237.161.47. Yep, works great. But I
understand nearly nothing about why! And it certainly handles a range from
0.0.0.0 through 255.255.255.255 better than does the other util.<g> Better
yet, I can modify it to spit out the lines as they'd actually be needed for
the firewall rules. That is nice, too!



Relevant Pages

  • Re: How to write to drive A: from CGI Perl
    ... >> If that does not look weird to you, then please go back to basics. ... Please (assuming that the quoted text is an actual excerpt from the HTML ... You will have a better version of Perl? ... for HTML or Perl or CGI or anything. ...
    (comp.lang.perl.misc)
  • Re: Crenshaws Compiler Tutorial: 68k Asm to X86 Vs Interpreting, Newbie Qs on Parsing and Pascal
    ... translating things to Perl on the way. ... Most tutorials ... the basics. ... > I learned about compilers by studying the James Hendrix Small C compiler. ...
    (comp.compilers)
  • Re: OO in Python? ^^
    ... > Weakly typed languages do not prevent you performing operations on ... Perl and at least the version of BASIC that I previously used ... are not weakly-typed languages either. ... classic microcomputer BASICs generally suffixed variable names in order ...
    (comp.lang.python)
  • RE: recusrive listing
    ... Subject: recusrive listing ... Do multiple question marks convert into a period or ... IO::All combines all of the best Perl IO modules into a single nifty ... IO::All adds dozens of other helpful idiomatic methods including ...
    (perl.beginners)
  • Re: diff between packages and modules
    ... they need to get the four basics ... Foo::Bar module as basic 'template' - and can demonstrate ... needing the full on external perl module. ...
    (perl.beginners)