Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Error with Win32::Console

by CoadToad (Acolyte)
on Oct 17, 2000 at 23:27 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-29 06:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found