Offer Kaye wrote:
Hi,
Can anyone tell me if it is possible to define 2 different formats for
the same filehandle?
The reason I am asking is that I want to print 2 different tables to
the same text file and I don't want to use printf statements. For me
at least, code that uses printf to print something as complex as a
text table is hard to both write and read, hard to understand and hard
to debug. It's also ugly, to boot :)
My current workaround is to close the file, reopen in append mode with a
different filehandle name and define the second format with this name.
Ugly, but works. Any other/better solutions?
Thanks in advance,
Duplicate the filehandle using the information in "perldoc -f open" and
create a new format for the new filehandle.
I just checked, and this works.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>