On Thu, Aug 7, 2008 at 9:38 AM, Tara <[EMAIL PROTECTED]> wrote:
> I'm trying to do a Perl script (PC has Perl5 installed) in a BAT file
> which will open the CMD prompt, interact with the user and copy files
> from one location to other directories. Does anyone know how to "dir"
> the files in a directory into an array and sort by date and return the
> ones within the past week? So far I have this code and it returns all
> the files:
>
> @files = `dir`;
> chomp (@files);
> print "$#files \n";
> if ( @files =~ /[Qq]/ ) {
> exit 0;
> }
> if ( @files =~ /xml$/ ) {
> print "Recently added XML files: $files \n";
> printf COPYLOG "Recently added XML files: @files \n";
> $type = "xml";
> }
> elsif ( @files =~ /tc$/ ) {
> print "You are copying an expected result file \n" ;
> printf COPYLOG "You are copying an expected result file \n" ;
> $type = "tc";
> }
> else {
> print "Invalid file type or @files doesn't exist in current
> directory\n" ;
> printf COPYLOG "Invalid file type or @files doesn't exist in
> current directory\n" ;
> $type = "bad";
> }
>
>
Apologies, but this list is for the discussion about the next
generation of perl (perl 6).
For help with the current version (perl 5), I'd recommend starting at
http://www.perl.org/ and looking through the online documentation and
the various community links.
That said, I'd recommend taking a look at the output of the command
"perldoc find2perl"
Regards.
--
Will "Coke" Coleda