in reply to Can I use a regex here?

If you put your log file names into an array, you can use map to do this:
@old_log_files = [ $LOG_FILE_1, $LOG_FILE_2, ...]; @new_log_files = map { "$OUT_DIR/allfiles/$_" } @old_log_files; for (i=0;$i<scalar @old_log_files; $i++) { rename $old_log_files[$i], $new_log_files[$i]; }

Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Replies are listed 'Best First'.
(jeffa) 2Re: Can I use a regex here?
by jeffa (Bishop) on Apr 17, 2001 at 01:30 UTC
    Leave the C-Style for loops for C:
    for (0..$#old_log_files) { rename $old_log_files[$_], $new_log_files[$_]; }
    So much nicer, and easy on the hands. :)

    Jeff

    R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
    L-L--L-L--L-L--L-L--L-L--L-L--L-L--