Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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:\test.pl line 2.

Code
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.

~CoadToad~

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!
      ~CoadToad~

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2022-01-21 21:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (59 votes). Check out past polls.

    Notices?