Yes Perl is very useful for doing the work stated, but the group needs to know 
from either a script you want to change or showing some code you desire to change, so 
they can assist and hopefully point you in the right direction.

        move,copy,rename can be handled by File::Copy
        zip files        can be handled by Archive::Zip

        I have attached a reply from Tmothy Johnson from this week.

        The list can be very helpful, but the best you can do is provide more detail 
and/or code, so the list can respond without guessing.

Wags ;)

-----Original Message-----
From: Auernheimer, Rebecca (CORP, Consultant)
[mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 09:26
To: [EMAIL PROTECTED]
Subject: usefulness of perl for production?


Hello all,
I want to use perl to replace our MS-DOS batch jobs.  The main purpose of
most of these batch jobs is to move, copy, rename, and zip files in a
windows (NT) environment.  I use a few variables to add the date into the
zip file name and to move the zip file into the appropriate month-named
directory.  I am having trouble finding information on getting perl to
handle these (overly?) simple functions.  I want to start very small and
gradually build on my knowledge to do more complicated things.  I have
started reading Learning Perl (2nd ed) and I was overwhelmed, partially
because the topics I wanted to cover were not addressed.  Someone suggested
looking into the "system" command so I scanned chapter 14, but it does not
seem to address my needs, either.  I looked at some web sites (perl.org,
cpan, perl.com, webmonkey) without finding what I needed.

My questions:
Is perl appropriate for the tasks I mentioned in the second sentence?  
If so, where can I get information about how to do those things?

Thank you so much for any input you can give me.
Rebecca

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--- Begin Message ---

Well, you didn't leave any code, but I'll give you what I just came up with
(I just started using this module a few days ago).  This is a script that
gets all of the files in the c:\temp directory and puts them in a ZIP
archive.  Basically you want to add files as members using the addFile()
method, and when you're done, output the result by using the
writeToFileNamed() method.

############################################

use Archive::Zip;
use strict;
my $zip = Archive::Zip->new();
my $zipname;

if(defined $ARGV[0]){
        $zipname = $ARGV[0];
}else{
        $zipname = "New ZIP Archive.zip";
}

chdir("c:\\temp");
opendir(DIR,".");
my @files = readdir(DIR);

while($_ = shift @files){
        unless($_ =~ /^\.{1,2}$/){
                print "   Adding $_...";
                if(-d $_){
                        opendir(DIR,$_) || warn "Failed to open directory
$_!\n";
                        foreach my $file(readdir(DIR)){
                                unless($file =~ /^\.{1,2}$/){
                                        push @files,$_."\\$file";
                                }
                        }
                }else{
                        if($zip->addFile($_)){
                                print "OK\n";
                        }else{
                                print "Failed!\n";
                        }
                }
        }
}
print "\nFile Selection Complete, writing to \"$zipname\"\n";
$zip->writeToFileNamed("$zipname");
                
#########################################
-----Original Message-----
From: Steven McCaffrey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 21, 2002 9:22 AM
To: [EMAIL PROTECTED]
Subject: newbie trying to zip files using archive::zip


Hello:

     I am trying to combine text files into a single zip file.  I've seen
the documentation for archive::zip and think this is close to what I need
but am still unsure how to use it.
I want to take file1.txt file2.txt file3.txt ...and output fileall.zip
Any user friendly help is appreciated.  I have activestate Perl 5.6.1.
Also, if I use the archive::zip module on Win32/NT can I then port to Unix?

Thanks,

Steve


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--- End Message ---
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to