[OT] Re: moving file using perl

Felipe Figueiredo philsf79 at gmail.com
Thu May 1 08:24:30 UTC 2008


On Thu 01 May 2008 04:41:21 OOzy Pal wrote:
> Hello,
>
> How can I move a file to a directory name DONE using perl. I tried
> this but it did not work?
>
> $file='Myfile';
> rename $file, 'Done/'$file;

you can use the File::Copy module.

use File::Copy "move";
move ($file, "Done/$file");

or even

move ($file, "Done/");

Se the perdoc of the module mentioned.

regards
FF




More information about the ubuntu-users mailing list