Question on adding code to perl.c
-----BEGIN PGP SIGNED MESSAGE-----
I've got a quick question for those more savvy in Perl internals than I
on this list.
One of the current problems is:
2) We need to add /usr/lib/perl5/i386-linux/5.004 to perl-5.004's path.
Otherwise, the various modules that are compiled and installed under
the non-versioned Perl won't work.
The way I did this was with the following code:
static char *archpath;
len = sizeof(ARCHNAME) + sizeof("/usr/lib/perl5//5.004");
New(23, archpath, len, char);
sprintf(archpath, "/usr/lib/perl5/%s/5.004", ARCHNAME);
/* Safefree(archpath); */
I pulled some of this code from incpush itself. I like the static
pointer idea, it's clever. From a quick test, it doesn't look like
init_perllib only gets called once as the name might suggest, so I made
the pointer static and only allocated once.
<email@example.com> <http://www.daft.com/~torin> <firstname.lastname@example.org> <email@example.com>
Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-800-921-4996
@ Sysadmin, webweaver, postmaster for hire. C/Perl/CGI/Pilot programmer/tutor @
@ Make a little hot-tub in your soul. @
-----BEGIN PGP SIGNATURE-----
Comment: Processed by Mailcrypt 3.5.1, an Emacs/PGP interface
-----END PGP SIGNATURE-----