Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Error with Win32::Console

by CoadToad (Acolyte)
on Oct 17, 2000 at 23:27 UTC ( #37221=perlquestion: print w/replies, xml ) Need Help??

CoadToad has asked for the wisdom of the Perl Monks concerning the following question:

I was messing around with the Win32::Console module and keep getting this error no matter what I try.

Error Message: Can't call method "Attr" on an undefined value at C:\ line 2.

use Win32::Console; $attr = $CONSOLE->Attr(); $CONSOLE->Attr($FG_YELLOW | $BG_BLUE);

I am taking this code directly from the CPAN site. And the module is installed.
I am using Activeperl.

Any help would be appreciated.


Replies are listed 'Best First'.
RE: Error with Win32::Console
by myocom (Deacon) on Oct 17, 2000 at 23:43 UTC

    Seems to me that you need to create a Win32::Console object first:

    use Win32::Console; my $console = new Win32::Console || die "Couldn't create object: $!\n" +; my $attr = $console->Attr(); # ... do s'more stuff...
      Thanks. I knew it had to be something simple. I feel kinda stupid going back and looking at it now.

      Thanks again!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://37221]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2022-05-26 10:47 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (93 votes). Check out past polls.