Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Term::Cap error...

Status
Not open for further replies.

gonzilla

Programmer
Apr 10, 2001
125
US
Hi,

I have a clear screen funciton that I took directly from the Perl Black Book that works fine on one server, but generates this error on another server...

Can't use string ("STDOUT") as a symbol ref while "strict refs" in use at /usr/local/lib/perl5/5.8.0/Term/Cap.pm line 442.

Here is the code

Code:
sub cls() {

    use POSIX;
    use Term::Cap;

    $termios = POSIX::Termios->new();
    $termios->getattr;
    $speed = $termios->getospeed;

    $termcap = Term::Cap->Tgetent({TERM => undef, OSPEED => $speed });
    $termcap->Tputs('cl', 1, STDOUT);

 }


Any ideas? Or, is there an easier way to clear the screen in a Perl script?

Thanks.

-Tyler

 
They are both on SUN. They do have different versions of Perl installed though....

The one it is bombing on is v5.8.0, the other it is fine on is 5.005_03

Could that be it?



 
Code:
Can't use string (`%s`) as %s ref while `strict refs` in use

(F) Only hard references are allowed by use strict refs. Symbolic references are disallowed.

Found this on
It might be that you'd need to explicitly reference the Terminal ID for both to work - just a guess.

Is there a difference between the two versions of Solaris running on the Sun boxes - assuming Solaris.

Or any patches, other than the difference between the Perl versions

HTH
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top