[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] MacPerl::LoadExternals problem



At 19.18 -0700 2000.06.29, Joseph A. DiVerdi wrote:
>A stuffed copy of XCMD.pm is attached for those interested. Any help
>in figuring out how to make it all work with the module in an
>arbitrary location would be greatly appreciated.

Huh.  That is odd.  Apparently, in XL.xs there is the code that tries to
figure out the path, but in this case, it is failing.  I'd think that it
should find it if you did ":Mac:XCMD.pm", but then it looks in your current
directory for that file.  So if running from the MacPerl console,
":site_perl:Mac:XCMD.pm" should work.  But you can't count on that.

"$ENV{MACPERL}site_perl:Mac:XCMD.pm" should work in most situations.  But
it would be nice if there were a better way to do it.  This patch might
help; instead of failing if it cannot resolve ":Mac:XCMD.pm", it continues
on to the next step, which is iterating through @INC.

Patch is for MacPerl 5.6.0, and it seems to work in my testing (that is,
the LoadExternals() call does not give an error; however, when I call
_XCMD(), I get dropped into Macsbug; it worked fine with the longer path
and MacPerl 5.2.0r4).

diff -c :XL.xs.orig :XL.xs
*** :XL.xs.orig	Thu Jul  6 16:42:14 2000
--- :XL.xs	Thu Jul  6 17:33:37 2000
***************
*** 219,230 ****
  		FSSpec	spec;

  		if (strchr(path, ':')) {
! 			if (!GUSIPath2FSp(path, &spec))
  				err = XLTryResLoad(&spec);
! 			else
! 				err = fnfErr;

! 			goto done;
  		}
  		{
  			AV *ar = GvAVn(PL_incgv);
--- 219,231 ----
  		FSSpec	spec;

  		if (strchr(path, ':')) {
! 			if (!GUSIPath2FSp(path, &spec)) {
  				err = XLTryResLoad(&spec);
! //			else
! //				err = fnfErr;

! 				goto done;
! 			}
  		}
  		{
  			AV *ar = GvAVn(PL_incgv);

-- 
Chris Nandor       |     pudge@pobox.com      |     http://pudge.net/
Andover.Net        | chris.nandor@andover.net | http://slashcode.com/

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org