On Thu, 06 Oct 2005, John Serink wrote:
> if($^O eq "MSWin32"){
> # Check which OS
>       $console = Win32::Console->new(STD_OUTPUT_HANDLE);

        $console = Win32::Console->new(Win32::Console::STD_OUTPUT_HANDLE());

> } else {
>       $console = Term::ANSIScreen->new();
> }
> 
> And that is the fly in the ointment. I get an error about
> STD_OUTPUT_HANDLE as it's a constant in the Win32::Console module but
> its not loaded yet on Windows and never loads on Linux, so the error
> makes the script abort.
> 
> D:\linux>perl init25g.pl 192.168.1.27 4002 client 10 13
> Bareword "STD_OUTPUT_HANDLE" not allowed while "strict subs" in use at
> init25g.pl line 73.

You need to use fully qualified names because "require" will not
import symbols into your namespace.  And you must append parenthesis
to tell Perl that this is a function call and not a bareword.  Barewords
are only treated as function calls if Perl knows at compile time that
it has a sub of the same name available to call.  Otherwise it will
treat them as unquoted strings, which is not allowed under "use strict".

Cheers,
-Jan


_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to