in reply to Re: Re3: How can I opendir, replace all files containing a space with .?
in thread How can I opendir, replace all files containing a space with .?

Ok, try the changedir suggestion from VSarkiss (elsewhere in this thread) at the top of your script. And check the return value of rename like this: rename($filename, $newfile) or warn "Couldn't rename: $filename -> $newfile: $!";

If you get the warning messages even with the chdir, then you have to put a full pathname as arguments for the rename. You can get them if $dir contains your path by putting the filename and pathname together like this: "$dir/$filename"

-- Hofmator

Replies are listed 'Best First'.
Re: Re5: How can I opendir, replace all files containing a space with .?
by nkpgmartin (Sexton) on Aug 15, 2001 at 21:04 UTC
    Ah, the chdir was what I was missing. It works now. Thanks a lot for your help!