Adedayo Adeyeye <mailto:[EMAIL PROTECTED]> wrote:

: Thanks.
: 
: To get the statistics of a file on my windows box, I ran the
: following script: 
: 
: 
: open FILE1, "Perfect.xls" or die "Cannot open file: $!";
: 
: my @stuff = stat "FILE1";
: 
: print "@stuff";
: 
: Unfortunately, I don't know why this never returned any values into
: my @stuff variable.

    Because stat() works on filenames, not file handles.

my @stuff = stat 'Perfect.xls';



: Next I tried this: 
: 
: open FILE1, "Perfect.xls" or die "Cannot open file: $!";
: 
: open FILE2, ">folder\Perfect.xls" or die "Cannot write to destination
: directory: $!"; 

    In perl, directories are separated by "/" not "\". "\P" is an
escaped "P".


: system ("copy FILE1 FILE2");
: 
: close FILE1;
: close FILE2;

use File::Copy 'copy';

copy( 'Perfect.xls', 'folder/Perfect.xls') or die "Copy failed: $!";


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328



-- 
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