> >>If all else fails, please write
> >>
> >>if ($^O eq 'whatever') {
> >>require 'Config.pm';
> >># ... or
> >>#     eval "use Config;"
> >>}
> >
> >If these are all functionally equivalent, then we can replace the 'use
> >Config'.
> 
> please do so.
> 
> Otherwise all usages of Tcl.pm will read Config.pm, which is huge.

It actually isn't that huge.  There is a small stub, and larger parts are only
brought in on use through AUTOLOAD.

> The only distionction between 'use Config' and 'require Config.pm' are
> 1. compile/run-time distinction and 2. call of 'import' function; but
> all these are negotiable for given $^O

OK, so I'm making the change and referring to s/$Config/$Config::Config/g.

> >CASE 1 is the pure-perl path (and is what Tkx in ActivePerl will use).
> >CASE 2 is may not possible in pure-perl, and is the needed fallback for
Apple.
> >CASE 3 is the general fallback - you'll need to leave this in regardless.
> >CASE 4 is a Win32-specific fallback that allows for the most popular Tcl
> >distribution to be found.
> 
> These are not all the cases (there are some STUB logic for 
> example, and some starkit)

But we only load external libraries in the stub case, and the rest is all
after we have the handle to the library.

> But there are some more logic that I am very inclined to add:
> 
> - in the PAR case, tk.dll should be found differently, in order to get
> needed resources
> - in case Tcl+Tk are built into Tcl.dll, extra call needed, again, for
> Tk resources to be found by Tk system
> 
> I hope this is doable via $ENV{PERL_TCL_DLL} or Tcl::DL_PATH 
> variable(s)

I believe it is.  That is what we are doing in ActivePerl with Tcl+Tkx.  You
can see this in action in 5.8.8.818:
        http://downloads.activestate.com/ActivePerl/Windows/5.8/

In particular, we locally patch it to insert the following in Tcl.pm:

unless ($DL_PATH) {
    require Config;
    for my $inc (@INC) {
        my $tkkit = "$inc/auto/Tcl/tkkit.$Config::Config{so}";
        if (-f $tkkit) {
            $DL_PATH = $tkkit;
            last;
        }
    }
}

and provide the tkkit prebundled.

Regards,

Jeff

Reply via email to