I'm going to add the reply to your latest node here, Confused -- please add futher responses as a reply, NOT as a new node.
Confused asked:
I understand that the output file can be specified when using a filehandle. If you use Print to output a file, how do you specify where the output goes?
There are a couple of ways. The quickest is like this (note that I'm using open, and not use Filehandle):
my $SQLlog = 'SQL.log';
open (SQL_LOG, ">$SQLlog") or warn "Cannot open SQL commands logging a
+t $SQLlog: $!\n";
print SQL_LOG "\n==========SQLCMDLOG===================BEGIN==========
+====================\n";
To break it down, first, define the name of the file the data is going into. This does not have to be done in a seperate varabile, but it's easier for debugging. Then use the open command to open the file for writing, and then print the data, but put the filehandle you defined before the data. In the code above, I say "print to the filehandle SQL_LOG such-and-such data."
Again, please look at the docs for open and print, and try the code above.
----Asim, known to some as Woodrow. |