I'm running the simple (so I thought) program below to build
a list with all my servers. I don't want servers that begin
with "w" nor "l" showing on the list. Here's my code:
open (PP, "net view |") || die "$!\n";
while (<PP>){
$machine = split;
if ($machine =~ m@^\\
.@i){
push(@servers,$machine);
}
}
close PP || die "$!\n";
open (OUT,">servers.log") || die "$!\n";
while (@servers){
print OUT "$_\n";
}
print "List built!\n";
close OUT || die "$!\n";
I think the problem is with the regexp but I can't see it!
Can someone help me out?
Thanks