Weekly Perl Script
Bill Jones
bill at fccj.org
Sun Apr 25 19:16:57 CDT 1999
On the Jax.PM jacksonville-pm-list 1.94.4;
"Bill Jones" <bill at fccj.org> wrote -
Hi All :]
As a new benefit for the Jacksonville Perl Monger
membership (now at 4 :) I present the kick off of
the "Weekly Perl Script" series.
Each Week, around Saturday or Sunday, I will submit
to the list a Perl Script which does something useful,
but one which isn't too hard to follow along with and
can be modified to attend other tasks.
I will post a script to the Jax-PM listserv and
allow one week for the group to discuss it; after
the week has passed I will either post a follow-up,
one which will help describe the functioning of
the prior weeks post or we will move on to a
new script to discuss that week. Fair enough?
BTW: The 'other' members may post script and/or
questions here as well. I'm not saying that
any of them will be answered - but together
I am sure we can discover a solution!
Here is this weeks offering for your review -
#!perl -w
use strict;
use diagnostics;
use Net::Telnet ();
my $t = new Net::Telnet (Timeout => 2,
Errmode => 'return',
Prompt => '/bash\$ $/');
my $domainNumber = "207.203.";
my $netWork = 46; # Starting place...
my $hostNumber = 0;
my $testTelnet = '';
my $msg = '';
my $ctr = 0;
$| = 1; # Flush the buffer...
while (1) {
if ($hostNumber > 253) {
if ($netWork == 47) { $netWork = 60;
} elsif ($netWork == 63) { $netWork = 76;
} elsif ($netWork == 87) { $netWork = 94;
} elsif ($netWork == 95) { $netWork = 206;
} elsif ($netWork == 211) { $netWork = 218;
} elsif ($netWork == 223) { exit; # Done...
} else { $netWork++;
}
$hostNumber = 0; # Reset it...
}
$hostNumber++;
$testTelnet = $domainNumber . $netWork . "." . $hostNumber;
$t->open("$testTelnet");
$msg = $t->errmsg;
print $ctr++, "\r";
print "\nMaybe \@ $testTelnet\n\n" unless $msg;
}
Look at it, think it over, and if you have
any questions, please post to the list.
Enjoy!
-Sneex- :]
_________________________________________________________________________
Bill Jones | Data Security Specialist | http://www.fccj.org/cgi/mail?dss
FCCJ | 501 W State St | Jacksonville, FL 32202 | 1 (904) 632-3089
Mentoring: http://tesla.fccj.cc.fl.us/cgi-bin/mentors.pl?cmd=show&uid=24
Jacksonville Perl Mongers
http://jacksonville.pm.org
jax at jacksonville.pm.org
The Jacksonville Perl Monger's Group is operated by -
Bill -Sneex- Jones ( sneex at usa.net ),
to whom send all praises, complaints, or comments...
More information about the Jacksonville-pm
mailing list