in reply to How to determine terminal size when piped data to STDIN?

Try $stuff = qx(stty -a </dev/tty 2>/dev/null); I *think* that works properly.
Note #1: must use only standard (default) Perl installation, so no CPAN modules (such as Term::ReadKey) allowed!

I continue to boggle when people mention this constraint. It's really quite an odd thing.

Replies are listed 'Best First'.
Re: Re: How to determine terminal size when piped data to STDIN?
by Anonymous Monk on Nov 14, 2003 at 18:06 UTC
    Also, you can specify 'size' to avoid parsing;
    ($rows, $cols) = split ' ', qx"stty size </dev/tty 2>/dev/null";
      OMG!!!!!!! You _ARE_ a Perl Monk!!!! IT WORKED!!! <jumping up and down for real> I utterly can't believe it...I bow to you...Thank you _so much_ for sharing your knowledge!!
      I truly thought there was no way to solve this...I am ashamed for doubting Perl...
Re: Re: How to determine terminal size when piped data to STDIN?
by mushu (Initiate) on Nov 14, 2003 at 23:02 UTC
    Only because it is being run by a "user" on a huge HP-UX network who cannot get anything installed on the server without jumping through hoop after hoop after hoop after... that is why the requirement of default installation. If I could reliably have him put the ReadKey.pm module in the current directory that would be great, but I tried that and apparently it needs "something else" to make it work. Otherwise I'd just send that module with my code and be done with it. :) Since this is my very first post here I am unaware of the "pissy" things that set people off. I will be more careful in the future...