Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: rotating files, is there a better way?

by merlyn (Sage)
on Apr 04, 2001 at 04:40 UTC ( [id://69553]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to rotating files, is there a better way?

my $prefix = "$to_dir/$base_name"; my $suffix = ".jpg"; my @names = "$prefix$suffix"; for (my $i = 0; $i < 10; $i++ ) { push @names, "$prefix.$i$suffix"; last unless -e $names[-1]; } while (@names >= 2) { rename_and_log($names[-2], $names[-1]); pop @names; }

-- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://69553]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.