4 use vars qw($VERSION @Pref);
6 @Pref = qw(CGI::Apache CGI); #default
17 ($file = $pack) =~ s|::|/|g;
18 eval { require "$file.pm"; };
23 #XXX warn "Going to try $pack\->new\n";
25 eval {$obj = $pack->new(@_)};
33 Carp::croak "Couldn't load+construct any of @Pref\n";
36 # there's a trick in Lincoln's package that determines the calling
37 # package. The reason is to have a filehandle with the same name as
38 # the filename. To tell this trick that we are not the calling
39 # package we have to follow this dirty convention. It's a questionable
40 # trick imho, but for now I want to have something working
48 CGI::Switch - Try more than one constructors and return the first object available
57 use CGI::Switch This, That, CGI::XA, Foo, Bar, CGI;
59 my $q = new CGI::Switch;
63 Per default the new() method tries to call new() in the three packages
64 Apache::CGI, CGI::XA, and CGI. It returns the first CGI object it
67 The import method allows you to set up the default order of the
72 perl(1), Apache(3), CGI(3), CGI::XA(3)
76 Andreas König E<lt>a.koenig@mind.deE<gt>