use strict;
use warnings;
use Pod::Usage;
use Getopt::Long;
use Time::Piece;
my $helpme = 0;
my $man = 0;
my $inputFileName = 'C:\\temp\\input.txt';
my $outputFileName = 'C:\\temp\\output.txt';
my $fileModifiedDate = '';
my $errorcode = 0;
my $DEBUG=0;
if(exists $ENV{DEBUG}) {
$DEBUG = ($ENV{DEBUG} eq "") ? 0 : $ENV{DEBUG};
}
GetOptions('help' => \$helpme, 'man' => \$man, 'infile=s' => \$inputFileName, 'outfile=s' => \$outputFileName) or pod2usage(2);
pod2usage(1) if $helpme;
pod2usage(-verbose => 2) if $man;
die 'No input file name specified!' unless $inputFileName;
die 'No output file name specified!' unless $outputFileName;
open(INFILE, '<', $inputFileName) or die "Could not open input file: $!";
open(OUTFILE, '>', $outputFileName) or die "Could not open/create output file: $!";
while( my $dir = <INFILE>) {
chomp $dir;
opendir DIR, $dir or die "could not open dir $dir: $!";
if (grep { $_ ne '.' and $_ ne '..' } readdir DIR) {
print OUTFILE $dir, "\n";
}
closedir DIR;
}
close INFILE;
close OUTFILE;
exit $errorcode;
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE