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;
In reply to compile error in perl script by kks_perlnewbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |