"John W. Krahn" wrote:

> > Also, I would like to run this from within a script instead of from the
> > command line.
> >
> > BTW...using PERL 5.8.0 on Windows2000 Pro
>
> Here is one way to do it:
>
> use warnings;
> use strict;
>
> my $file = shift or die "usage: $0 filename\n";
>
> rename $file, "$file.bak" or die "Cannot move $file to $file.bak: $!";

I would say that this is the wrong place for the rename.  Computers do crash.
If a crash occurs while this program  is in progress, then he is left with a
renamed original.  Better to succesfully complete the processing, and then
rename the output file to the nput filename.  I use .tmp instead of .bak when
doing this, since that better revflects the sequence.

Joseph


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

Reply via email to