kks_perlnewbie has asked for the wisdom of the Perl Monks concerning the following question:
use Getopt::Std; $usemsg = "Usage: pre_DAD.pl -i <input_folder> -w <working_dir> -o <o +utput_file> \n"; getopts('i:o:w:', \%options); if ((!exists $options{i}) || (!exists $options{o}) || (!exists $option +s{w}) ) { die $usemsg; } $inputfolder = $options{i}; $outputfile = $options{o}; $workingdir = $options{w}; #open the input directory to get a file list opendir(my $indir, $inputfolder) || die "Can't open input directory $i +nputfolder $! \n"; while (readdir $indir) { if ($_ =~ /txt$/){ my $tfn = "/".$_; move ($inputfolder.$tfn,$workingdir); } } # close the input directory closedir $indir;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: compile error in perl script
by toolic (Bishop) on Sep 21, 2016 at 18:20 UTC | |
|
Re: compile error in perl script (not)
by hippo (Archbishop) on Sep 21, 2016 at 22:26 UTC |