blk.txt
#!perl
use strict;
use warnings;
### init
my $dir = q(\\fileserver\login$);
my $file = $dir .q(\accounts.txt);
### run `net user...`
open(NET_USER, "net user /domain |") or die $!;
while(<NET_USER>) {
### skip these lines
next if(/The\srequest/);
next if(/User\saccounts\sfor/);
next if(/---/);
### do something else with the rest...
chomp;
my(@cols) = split /\s+/;
### print cols
for my $c (@cols) {
print "$c\n";
}
}
### the end
close NET_USER;
exit 0;