in reply to read write from a file
Maybe you don't have permissions. Add error checking to your open statements:
open(DICE, ">data.txt") or die "Can't open: $!";
And probably good to use lexical file handles and the three parameter form of open.
Also, to read, you need to remove the '>' from your open:open my $fh, '>', 'data.txt' or die "Can't open: $!";
open(DICE, "data.txt");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: read write from a file
by friar tux (Novice) on Apr 08, 2011 at 18:09 UTC | |
by wind (Priest) on Apr 08, 2011 at 18:17 UTC | |
by friar tux (Novice) on Apr 08, 2011 at 18:37 UTC | |
by wind (Priest) on Apr 08, 2011 at 20:25 UTC |