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

[MacPerl] MacPerl::LoadExternals problem



I am working on a project which involves the inclusion of external 
XCMD/XFCNs in a module. Unfortunately, there is a problem involving 
the file path supplied to the MacPerl::LoadExternals function that I 
have been unable to solve. Here is a short description of the problem:

A simplified test module is named "XCMD.pm". It contains one XCMD in 
its resource fork which does nothing more than return a static string 
to indicate that it has been entered. It also contains some simple 
glue code in its data fork which calls the MacPerl::LoadExternals 
routine to make the XCMD available and provides a method for 
interfacing to the test Perl program.

The test module is placed in the "site_perl" folder. The contents of 
its data fork follow:

	#! perl -w
	package XCMD;
	MacPerl::LoadExternals("XCMD.pm");
	sub test { return _XCMD() }
	1;

A separate test program "uses" the module, calls the method, and 
prints the received string. It contains the following code:

	#! perl -w
	use XCMD;
	print XCMD->test, "\n";
	exit;

When the test program is executed, it executes successfully returning 
the following message:

	XCMD entered!

So far, so good.

Now, if the module is to be placed in the "site_perl:Mac" folder and 
the following changes made to the module and test program:

	#! perl -w
	package Mac::XCMD;
	MacPerl::LoadExternals("Mac::XCMD.pm");
	sub test { return _XCMD() }
	1;

	#! perl -w
	use Mac::XCMD;
	print Mac::XCMD->test, "\n";
	exit;

When the test program is executed, it fails returning the following message:

	# MacPerl::LoadExternals("Mac::XCMD.pm"): File not found..
	File 'Lulu:Applications:MacPerl Ÿ:site_perl:Mac:XCMD.pm'; Line 7
	# BEGIN failed--compilation aborted.
	File 'Lulu:Desktop Folder:test.t'; Line 2


I have experimented with several different file paths as the 
LoadExternals argument. A hard-coded absolute path, i.e., 
"Lulu:Applications:Mac Perl Ÿ:site_perl:Mac:XCMD.pm" executes 
successfully. However, I have been unable to find a relative path 
which does execute successfully.

A stuffed copy of XCMD.pm is available for those interested; just 
send me a note and I'll send it to you. Any help in figuring out how 
to make it all work with the module in an arbitrary location would be 
greatly appreciated.

Best regards,
Joseph
--
Joseph A. DiVerdi, Ph.D., M.B.A.
<mailto:diverdi@XTRsystems.com>             970.221.3982 (voice)
<http://www.XTRsystems.com>                 970.224.3723 (fax)
%PGPKey=('D50A9E33',[1024,'D790 3F87 2944 1E65 3286 1AD4 1A10 C5E1 D50A 9E33'])

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