J
John
I'm using Spreadsheet:arseExcel via an example program, xls2txt.pl
xls2txt.pl turns an Excel file into text and pumps the text out with
print statements, sending it to STDOUT.
Without changing the original, I want to pump the text to an
intermediate file, then start with my own code to massage the text with
regexes, do some table lookups and send the results to a third and
fourth file.
Before calling the example code, I did:
open STDOUT, ">$scratch_file";
This successfully gave me my scratch file.
Now when I start my own suspect manipulations, I wanna resume printing
to the screen.
I tried ...
open STDOUT, ">/dev/console";
.... and while it didn't error out, I didn't see any of my subsequent
diagnostic text.
I take it I'm opening the wrong device.
Is there a proper way to do this?
Was thinking there was a way to query for a file object originally
associated with STDOUT, to save a pointer to that, and reassign it
later. But that's vague C-influenced thinking and terminology--I don't
know how I'd translate it to a CPAN or Google search.
If this is impossible -- or an egregious breach of Perl etiquette -- I
suppose I can make my own version of xls2txt. But I'm nonetheless
curious, and lazy.
John Campbell
xls2txt.pl turns an Excel file into text and pumps the text out with
print statements, sending it to STDOUT.
Without changing the original, I want to pump the text to an
intermediate file, then start with my own code to massage the text with
regexes, do some table lookups and send the results to a third and
fourth file.
Before calling the example code, I did:
open STDOUT, ">$scratch_file";
This successfully gave me my scratch file.
Now when I start my own suspect manipulations, I wanna resume printing
to the screen.
I tried ...
open STDOUT, ">/dev/console";
.... and while it didn't error out, I didn't see any of my subsequent
diagnostic text.
I take it I'm opening the wrong device.
Is there a proper way to do this?
Was thinking there was a way to query for a file object originally
associated with STDOUT, to save a pointer to that, and reassign it
later. But that's vague C-influenced thinking and terminology--I don't
know how I'd translate it to a CPAN or Google search.
If this is impossible -- or an egregious breach of Perl etiquette -- I
suppose I can make my own version of xls2txt. But I'm nonetheless
curious, and lazy.
John Campbell