John Serink wrote:
> However, this works:
> use strict;
> use warnings;
>
> my $windoze;
>
> BEGIN {
> $windoze = 1 if $^O eq 'MWin32';
> if ($windoze) {
> print "Looks like its Windoze\n";
> eval "use Win32::Console";
> } else {
> print "Looks like its not Windoze\n";
> eval "use Term::ANSIScreen";
> }
> }
>
> # ...
>
> my $console;
> if ($windoze) {
> no strict;
I suppose you could wrap it into an eval to delay the interpretation.
eval "\$console = Win32::Console->new(STD_OUTPUT_HANDLE)";
> print "Win32::Console \n";
> $console = Win32::Console->new(STD_OUTPUT_HANDLE);
> } else {
> print "Term::ANSIScreen \n";
> $console = Term::ANSIScreen->new();
> }
>
>
> Don't really like have the 'no strict' in there but it's a work around
> unless we can come up with something more elegant.
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs