laziness, impatience, and hubris | |
PerlMonks |
Re^3: Read files not subdirectoriesby parv (Parson) |
on Jan 30, 2015 at 03:17 UTC ( [id://1115020]=note: print w/replies, xml ) | Need Help?? |
Consult a beginner level Perl book ("Beginner Perl" for an example) to understand difference between file and file handle; currently selected file handle for print & its various forms.
Actually use the file handle, not a file path, to read a line.
The directory path is not a file handle but a string. If there is none such open file handle, print will fail. To write to a file for a specific file handle, open the file in write mode; use print FILEHANDLE LIST syntax; see print. To copy or move files, see File::Copy.
In Section
Seekers of Perl Wisdom
|
|