hi
Try adding
Win32::Console->import;
and
Term::ANSIScreen->import;
Before "require"
El Jueves 06 Octubre 2005 10:13, John Serink escribió:
> Hi All:
>
> Ok, I need to use either Win32::Console or Term::ANSIScreen depending
> whether I'm on a Linux platform or Windoze box, so I do this:
> if($^O eq "MSWin32"){
> # Check which OS
> print("Looks like its $^O\n");
> require Win32::Console;
> } else {
> require Term::ANSIScreen;
> }
> Works fine, however, later on the code I need to create a console object
> like this:
> if($^O eq "MSWin32"){
> # Check which OS
> $console = Win32::Console->new(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.
>
> Execution of init25g.pl aborted due to compilation errors.
>
> How do I get around this?
>
> Cheers,
> john
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs