[EMAIL PROTECTED] wrote: > Thanks for the varied suggestions. I'm still dealing with a few things > I cannot explain. I have provided below a very simple program that > produces errors in two scenarios, each case is resolved by reverting > back to the regular use statement. > > #EXAMPLE1: > #!/usr/bin/perl -w > use strict; > > my $GUI = 1;
Try something like : my $GUI; BEGIN { $GUI = 1; } $GUI needs to be compiled on pass 1 before the use is done. > use if $GUI,'Tk'; > use if $GUI,'Win32Util'; > > my $top; > > if ($GUI) { > $top = MainWindow->new(); > Win32Util::maximize($top); > } else { > print "command line.\n"; > } > > #result > #Can't locate object method "new" via package "MainWindow" (perhaps you > forgot to load "MainWindow"?) at C:\DATA\SESS_KILL\test.pl line 12. > _______________________________________________ Perl-Unix-Users mailing list Perl-Unix-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs