Probably the simplest way to do this would be to use the File::Copy
module.  It's about as straightforward as you can get.

move($BNY_DOWNLOAD."\\".$filename,$BNY_DATA."\\".$filename) or
die("Couldn't copy $filename to $BNY_DATA! $!\n");


-----Original Message-----
From: kilaru rajeev [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 12, 2006 10:44 AM
To: beginners@perl.org
Subject: Copying files in windows from one directory to the other

Hi,

I got some  files in $BNY_DOWNLOAD which is a directory in windows. Now
i
have to identify most recent one in that file and
have to move it $BNY_DATA directory it is also a directory. To identify
the
most recent file I used sort command and sorted it
by using -M and and space ship operators. It is returning list of files
in
that directory that are sorted by the last modification order.
I'm getting that most recently modified as the first element in the
sorted
list. Now I want to move this file from this $BNY_DOWNLOAD
to $BNY_DATA directory. I'm not familiar with the windows environment
that's
why please help elaborately. Waiting for your earlier responce. Please
note
I'm have to use the $BNY_DATA  and $BNY_DOWNLOAD while copying.

Regards,
Rajeev


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to