I'm on perl, version 5.005_03 built for i386-freebsd...the code is as follows:
open(FH,"+<./file.dat") || die("Can't open ./file.dat for reading/writ
+ing: $!");
flock(FH,LOCK_EX);
seek(FH,0,0);
@dat = <FH>;
foreach (@dat) {chomp}
# this is where I process @dat, and when I feed text
# manually into it, it works. the problem doesn't
# lie in this segment of the code
seek(FH,0,0);
print FH join("\n",@dat);
flock(FH,LOCK_UN);
close(FH);
Now, i can open the file for reading, and i can open it for writing, and both work fine. But when I try reading AND writing, it doesnt spring an error, it simply doesnt read anything from or write anything to the file. Should I try +>instead of +<or what? | [reply] [d/l] [select] |
| [reply] [d/l] [select] |