Win has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: rename file giving problems
by shmem (Chancellor) on May 04, 2007 at 14:25 UTC
    Use the File::Spec::catpath function to construct your filename:
    $full_path = File::Spec->catpath( $volume, $directory, $file );

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Re: rename file giving problems
by kunwon1 (Sexton) on May 04, 2007 at 14:30 UTC

    Are you sure you have permission to overwrite/write to the location in question? If you're getting permission denied errors, that'd be the first thing I'd check.

    What sort of platform is this being run on?

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: rename file giving problems
by shmem (Chancellor) on May 04, 2007 at 17:26 UTC
    You should drop the bad habit of double-quoting single variables. Once you do that with references, you will be bitten.
    rename ($dir_and_filename, 'C:'.$specific_recipient_directory.'/'.$fil +e_names[0]) or warn $!;

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}