CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [richsark] need another set of eyes on my perl script: Edit Log



FishMonger
Veteran / Moderator

May 1, 2009, 11:17 AM


Views: 4750
Re: [richsark] need another set of eyes on my perl script

This is the version of his script I was referring to.

Code
#!perl -w 
my @dnsoptions;
my $subnet;
open(my $in, "<m-names2.txt") or die "Could not open m-names2.txt: $!\n";
while(<$in>) {
$subnet = $_;
print "Checking $subnet\n";
@dnsoptions = `./getobjectlst.exe -u Xxx-p Xxx -a $subnet -o rich`;
if (@dnsoptions) { # @dnsoptions is not empty
if (join(" ",@dnsoptions) =~ /Error 48: This subnet does not exist./) {
print "dnsoptions contains the Error 48.\n";
} else {
print "dnsoptions was created successfully, it's size = $#dnsoptions\n";
}
} else {
print "dnsoptions is null or undefined, going on to the next subnet\n";
}
print "====================================\n";
}
close($in);


BTW, please use the code tags, it makes it much easier to read.


(This post was edited by FishMonger on May 1, 2009, 11:19 AM)


Edit Log:
Post edited by FishMonger (Veteran) on May 1, 2009, 11:18 AM
Post edited by FishMonger (Veteran) on May 1, 2009, 11:19 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives