in reply to Evolution of a Perl Programmer (new backup script)
foreach my $file (@$exc) { if($_ eq $file) { $skip =1; } }
is broken, since it'll keep looping through checking for exclusions even if it's already found that this file or directory is in fact excluded from being backed up. Realistically, in a small, simple backup script like this, run on your own computer most of the time, it probably wouldn't matter. But it IS generally a good idea to leave a loop when you no longer need it to execute. :)
foreach my $file (@$exc) { if($_ eq $file) { $skip =1; } last if $skip; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Evolution of a Perl Programmer (new backup script)
by extremely (Priest) on Dec 21, 2000 at 16:48 UTC | |
by chipmunk (Parson) on Dec 23, 2000 at 08:40 UTC | |
by Anonymous Monk on Dec 23, 2000 at 07:38 UTC |