Syntax highlighting in Perl

Nicholas Clark nick at
Sun Oct 15 11:14:18 BST 2006

On Sun, Oct 15, 2006 at 10:29:47AM +0100, Nik Clayton wrote:

> One question -- when it does the swig build, the makefile that ships with 
> it has this definition:
>     PERL_INC=/usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/
> That's not going to work on my FreeBSD box.  The equivalent path is:
>     /usr/local/lib/perl5/5.8.8/mach/CORE
> poking around (and I don't see a variable that 
> corresponds to that.  The closest I get is doing something like this:
>     perl -MConfig -e 'print $Config{archlib}, "/CORE\n"'
> Is that (archlib) the right variable to use?  Can I always append "/CORE" 
> and be guaranteed of getting the right directory?

Technically no, it should be archlibexp. archlib can start with ~


$ ~/Reference/5.8.0/bin/perl5.8.0 -MConfig -wle '$file = "$Config{archlib}/CORE/perl.h"; print "$file is @{[-s $file]} bytes"'
Use of uninitialized value in join or string at -e line 1.
~/Reference/5.8.0/lib/perl5/5.8.0/i386-freebsd/CORE/perl.h is  bytes

$ ~/Reference/5.8.0/bin/perl5.8.0 -MConfig -wle '$file = "$Config{archlibexp}/CORE/perl.h"; print "$file is @{[-s $file]} bytes"'
/export/home/nwc10/Reference/5.8.0/lib/perl5/5.8.0/i386-freebsd/CORE/perl.h is 118851 bytes

But yes, "$Config{archlibexp}/CORE" is the directory you want:

$ perl5.00503 -MConfig -wle '$file = "$Config{archlibexp}/CORE/perl.h"; print "$file is @{[-s $file]} bytes"'
/usr/libdata/perl/5.00503/mach/CORE/perl.h is 68016 bytes

Nicholas Clark

More information about the mailing list