in reply to Re^2: Printing text from scrolled window?
in thread Printing text from scrolled window?

OP: "Preferably (if it is possible) the text could be extracted as an array ..."

DWIM is Perl's answer to Gödel
  • Comment on Re^3: Printing text from scrolled window?

Replies are listed 'Best First'.
Re^4: Printing text from scrolled window?
by Fletch (Bishop) on Jul 28, 2006 at 19:00 UTC

    Oop, quite right. I missed that part of the original question.

    If the OP's trying to post-process the contents line-by-line before printing that's something completely different of course, but I didn't get that from the overall question (and it only would seem that way when you actually read that one un-parenthetical parenthetical aside which I missed).

    Otherwise the objection still remains: if you're just trying to print the contents out somewhere, it's unnecessary work to split to lines just to add back newlines.

    Update: And even if you are post-processing things from an array I'd tend to use something along the lines of for( @lines ) { my $line = munge($_); print $line, "\n"; } rather than joining for one big print just in the interest of efficiency.

    Useless observation: Posting #2000. Break out the crepe paper and confetti.