http://qs1969.pair.com?node_id=499917


in reply to Capturing the text in a Console Window

It is unclear to me what you're trying to do - are you trying to capture text that's already sitting in the console window when your script starts, or are you trying to run a command from inside your perl script and then read what the command spit out to the screen? Note that the first of those two is much more difficult than the second.

Also, if you're trying to capture text already sitting on the console, is your perl script attempting to read its own console, or someone else's? The first of those two tasks is much easier.

--
@/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/