in reply to opening a file
Your code:
open($site_dnm); @DNM = <$site_dnm>; close($site_dnm);
One immediate problem is that open requires a filehandle AND a filename, i.e. open FOO, "foo.txt";
Or, even better,
open FOO, "foo.txt" or die "Can't open foo.txt: $!\n";
Which will abort the script and tell you why it couldn't open.
Then, when you read, you read from the filehandle, i.e. my @foo = <FOO>;
See perlfunc:open for more details.
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: opening a file
by Shendal (Hermit) on Nov 01, 2000 at 02:14 UTC | |
|
RE: RE: opening a file
by ImpalaSS (Monk) on Oct 31, 2000 at 22:36 UTC | |
by kilinrax (Deacon) on Oct 31, 2000 at 23:01 UTC |