I appreciate the replies so much. I start out with a command line like this: "backup.bat mm dd yy yyyy" where mm is the 2-digit month, dd is the 2-digit day, yy is the 2-digit year, and yyyy is the 4-digit year. Those are my variables, as I suppose they would be called. (Besides some programming as a kid on my commodore 64 computer, MS-DOS is my first exposure to programming.) I am using ActivePerl 5.6. Here is the MS-DOS code that I want to write in perl:
SET mm=%1 SET dd=%2 SET yy=%3 SET yyyy=%4 :CHECKPSR IF NOT EXIST e:\reports\REJECTS-%mm%%dd%%yyyy%.psr GOTO FILEZIP :PSRCOPY COPY e:\reports\REJECTS-%mm%%dd%%yyyy%.psr c:\prod\output\ :FILEZIP PKZIPC -add e:\tepcbkup\AG%mm%%dd%%yy% c:\prod\output\*.* :ORGANIZE IF "%mm%"=="01" SET mth=01JAN IF "%mm%"=="02" SET mth=02FEB IF "%mm%"=="03" SET mth=03MAR IF "%mm%"=="04" SET mth=04APR IF "%mm%"=="05" SET mth=05MAY IF "%mm%"=="06" SET mth=06JUN IF "%mm%"=="07" SET mth=07JUL IF "%mm%"=="08" SET mth=08AUG IF "%mm%"=="09" SET mth=09SEP IF "%mm%"=="10" SET mth=10OCT IF "%mm%"=="11" SET mth=11NOV IF "%mm%"=="12" SET mth=12DEC MOVE e:\tepcbkup\AG%mm%%dd%%yy%.zip e:\tepcbkup\%mth%\ :CHK_PSR IF NOT EXIST c:\prod\output\*.psr GOTO DAT_DEL :PSR_DEL DEL c:\prod\output\*.psr :DAT_DEL DEL c:\prod\output\email.dat (end code) If someone felt like writing that out in perl, I would be ecstatic. Thanks, Rebecca ----------------------------------------------------------------- -----Original Message----- From: Wagner-David [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 10:46 AM To: Auernheimer, Rebecca (CORP, Consultant); [EMAIL PROTECTED] Subject: RE: usefulness of perl for production? 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] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]