in reply to Basic, writing to a file
However, when you do while (<FH>) you're telling perl to try to read from the file, which you've just told it it can't do, and thus you get your error. Instead, you probably want:
to simply write one line out to the file. Update yea, forgot the FH in the print line.my $sql_log = "c:\\temp\\sqllog.out"; open (FH, ">$sql_log") or die "can't open file $! \n"; print FH "test"; close FH;
If you're looking to do something more complex, let us know what you're trying to do as there's probably more to this code than what you've given us.
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Basic, writing to a file
by suaveant (Parson) on Nov 27, 2001 at 19:42 UTC | |
|
Re: Re: Basic, writing to a file
by dreman (Acolyte) on Nov 27, 2001 at 19:48 UTC |