perl file handle
whats the difference between
open (OLD, "< file") open (NEW, "> file2") |
One reads from the file, and one writes to it.
Specifically, open (OLD, "<file") opens it for reading only. ">" opens with write-ability (if the file you're working with allows you to write to it. If it doesn't, you may get an access error the first time you try to write to the file). |
ok so what about this then
open (OLD, "file") |
The file is open as read-only, '<' is not mandatory
try : perldoc -f open |
Or here:
http://www.comp.leeds.ac.uk/Perl/filehandling.html (The first result from google when searching on "Perl file open") :) |
so this
open (OLD, "file") is the same thing as this? open (OLD, "<file") |
Yep :)
|
thanks so much.
|
All times are GMT -5. The time now is 11:34 AM. |