in reply to transfering a particular kind of file
i am not able to copy non empty files onlyYou want to selectively copy only files which aren't empty?
You're not actually reading from READFILE, nor writing to WRITEFILE. You've merely opened them for reading and writing.my @lines = grep { -s && "$source/*.log" } readdir ($DIR); foreach my $file (@lines){ $newfile =~ s/\.old$/.new/; open READFILE, "$..../$file"; open WRITEFILE, ">$d../$newfile";
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 | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |