in reply to transfering a particular kind of file

i am not able to copy non empty files only
You want to selectively copy only files which aren't empty?

my @lines = grep { -s && "$source/*.log" } readdir ($DIR); foreach my $file (@lines){ $newfile =~ s/\.old$/.new/; open READFILE, "$..../$file"; open WRITEFILE, ">$d../$newfile";
You're not actually reading from READFILE, nor writing to WRITEFILE. You've merely opened them for reading and writing.

What do you mean for && "$source/*.log" to achieve? Perhaps use /pattern/ instead of "pattern".

Use File::Copy to copy it somewhere after getting the list of files.

Update: ah, you've really just stuffed the condition.

-David

Replies are listed 'Best First'.
Re: transfering a particular kind of file
by asdfghjkl (Initiate) on Nov 05, 2007 at 06:53 UTC
    i had to copy each and every file interchange the text and copy to the destionation dir with the extension name of each file changed. 20071110 Edited by Co-Rion: Restored node from backup
A reply falls below the community's threshold of quality. You may see it by logging in.