kirk123 has asked for the wisdom of the Perl Monks concerning the following question:
Hi:
I am trying to rename the following directories:
C:\elmPaul\jod25573786-2k2 C:\elmPaul\jod25573786-2k2\wed25573786-2k2
I'm unable to rename both of these directories using :
finddepth (\&update_file , "C:\\elmPaul" ); sub update_file { if( /(.*)$old_hostname(.*)/i ) { $concat = "$1$new_hostname$2"; rename($_, $concat) || print "error can't renames:$!"; }
But I am able to rename ONLY "C:\elmPaul\jod25573786-2k2\wed25573786-2k2" using:
sub update_file { if( /(.*?)$old_hostname(.*?)/i ) { $concat = "$1$new_hostname$2"; rename($_, $concat) || print "error can't renames:$!"; }
Does anybody knows why? Please advise.
--kirk
Edited 2002-08-22 by Ovid
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't rename all directories but only some
by chromatic (Archbishop) on Aug 23, 2002 at 01:11 UTC | |
by kirk123 (Beadle) on Aug 23, 2002 at 01:15 UTC | |
by simeon2000 (Monk) on Aug 23, 2002 at 03:36 UTC | |
|
Re: Can't rename all directories but only some
by sauoq (Abbot) on Aug 23, 2002 at 02:00 UTC | |
|
Re: Can't rename all directories but only some
by helgi (Hermit) on Aug 23, 2002 at 13:05 UTC | |
|
Re: Can't rename all directories but only some
by greenFox (Vicar) on Aug 23, 2002 at 03:52 UTC |