|We don't bite newbies here... much|
FORMAT Troubleby SolidState (Scribe)
|on Jul 05, 2006 at 05:43 UTC ( #559248=perlquestion: print w/replies, xml )||Need Help??|
SolidState has asked for the wisdom of the Perl Monks concerning the following question:
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,
Back to Seekers of Perl Wisdom