[kw-pm] File I/O

Robert Pike roberthpike at yahoo.com
Wed Aug 25 08:21:18 PDT 2010


Hey all,
    Wondering what people most commonly use to open, lock, read, update, and write back to a file. I've been looking at using the open function along with +> but cannot seem to read from the filehandle using the following piece of code (just simple test code) :

open(FH, "+>somepath");
my @ca = <FH>;   
print join("<br>", @ca); // prints nothing to the screen

    I was wondering what alternatives peopel would give to the above code but also an explanation to why the above code doesn't result in the printing of the contents of the file (to the screen)? Thanks in advance for any insight given.

Rob




More information about the kw-pm mailing list