in reply to Re: RFC: Changing Perl Config settings
in thread Changing Perl Config settings

A simple test script tells me that my $ENV{'INCLUDE'} environment variable is full of directories, which aren't being passed to the compiler via Perl or CPAN... ...I think I need to rewrite my script to build an @include from $ENV{'INCLUDE'}, but this is why I needed meditate on it :)
use strict; use warnings; my @include = @INC; print '@INC =('.(join ",", @include).")\n\n"; print '%INCLUDE%=('.$ENV{'INCLUDE'}.")\n";
Gives the following output:
I:\Documents\Perl\U3 Perl Config scripts>perl testenv.pl @INC =(I:/strawberry/perl/lib,I:/strawberry/perl/site/lib,.) %INCLUDE%=(I:\System\GTK\INCLUDE;I:\System\GTK\INCLUDE\GTK-2.0;I:\Syst +em\GTK\INC LUDE\GLIB-2.0;I:\System\GTK\INCLUDE\PANGO-1.0;I:\System\GTK\INCLUDE\CA +IRO;I:\Sys tem\GTK\INCLUDE\ATK-1.0;I:\System\GTK\INCLUDE\GTKGLEXT-1.0;I:\System\G +TK\LIB\GTK -2.0\INCLUDE;I:\System\GTK\LIB\GLIB-2.0\INCLUDE;I:\System\GTK\LIB\GTKG +LEXT-1.0\I NCLUDE;I:\System\GTK\INCLUDE\LIBGLADE-2.0;I:\System\GTK\INCLUDE\LIBXML +2;I:\straw berry\c\include;I:\strawberry\perl\lib\CORE;\usr\include;C:\System\GTK +\INCLUDE;C :\System\GTK\INCLUDE\GTK-2.0;C:\System\GTK\INCLUDE\GLIB-2.0;C:\System\ +GTK\INCLUD E\PANGO-1.0;C:\System\GTK\INCLUDE\CAIRO;C:\System\GTK\INCLUDE\ATK-1.0; +C:\System\ GTK\INCLUDE\GTKGLEXT-1.0;C:\System\GTK\LIB\GTK-2.0\INCLUDE;C:\System\G +TK\LIB\GLI B-2.0\INCLUDE;C:\System\GTK\LIB\GTKGLEXT-1.0\INCLUDE;C:\System\GTK\INC +LUDE\LIBGL ADE-2.0;C:\System\GTK\INCLUDE\LIBXML2;c:\system\usr\include)

I'm not entirely sure what this is telling me about the relationship of @INC and $ENV{'INCLUDE'}. One seems to be where Perl looks for Perly libraries... which may be set wrong, and the other is as I expect it to be configured and should point the compiler to all the appropriate include directories.

Note: The I:\ prefixed paths have beens set up by my command prompt script, while the C:\ based paths are from my computer's original environment variables.

Replies are listed 'Best First'.
Re^3: RFC: Changing Perl Config settings
by Corion (Patriarch) on Feb 23, 2008 at 08:43 UTC

    @INC is where Perl looks for *.pm files.

    $ENV{INCLUDE} is where the C compiler looks for *.h and *.c files.

    The two bear little to no relation to each other.

      Ya, thanks. I had figured|rememberd that eventually. I'm beginning to think my include library is incomplete (the module Glib-1.164p still won't compile), but my program does seem to help Perl and it's modules find things easier.

      The program's been updated and now uses $ENV{'INCLUDE'} as the source of include directories, so I only have to maintain the include paths list in one place.