in reply to How to do a recursive rename ?

you loop on the files matched by the glob.
So for each filename the s/// calculates the new filename $new
for ( glob "*.abc" ) { ($new = $_) =~ s/\.abc$/.edf/; rename $_, $new or warn "can't rename '$old' to '$new'"; }

Replies are listed 'Best First'.
RE: Re: How to do a recursive rename ?
by Adam (Vicar) on Sep 12, 2000 at 04:09 UTC
    Oh, I see what you're doing now. I kind of glanced at it and said, "but why would he bind $_ to a pattern match?"... he he, because you aren't.

    By the way, you can edit your old posts to add updates and the like (or to fix mistakes like your $old) by going to the node itself.