I don't know the modules but had similar problems with other (at least  it 
seems so...)
 
You may need to import the modules constants
 
BEGIN { 
  if($^O eq "MSWin32"){
  # Check which OS
          print("Looks like its $^O\n");
          require Win32::Console;
          import Win32::Console;
  } else {
          require Term::ANSIScreen;
  }
}
 
For the linux problem you may put the windoze code in a block with warnings 
switched of. not very elegant, but give it a try...
 
Dietmar

        -----Ursprüngliche Nachricht----- 
        Von: John Serink [mailto:[EMAIL PROTECTED] 
        Gesendet: Do 06.10.2005 10:13 
        An: [email protected] 
        Cc: 
        Betreff: Cross platform issues
        
        

        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

Reply via email to