in reply to Re^2: Using environment variables in xi:include
in thread Using environment variables in xi:include

I'm not sure if I understand you correctly. Sure you can use variables instead of hardcoding the paths. You can also use Perl environment variables by using %ENV. Try the code below to get an overview.

use strict; use warnings; foreach my $key (keys(%ENV)) { printf("%-10.10s: $ENV{$key}\n", $key); }

Output on my system (slightly edited)

HOME : /Users/dharry LOGNAME : dharry DISPLAY : /tmp/launch-uz3Zcp/:0 COMMAND_MO: unix2003 VERSIONER_: no PATH : /usr/bin:/bin:/usr/sbin:/sbin APP_ICON_2: ../Resources/Eclipse.icns SHELL : /bin/bash JAVA_START: 1 SSH_AUTH_S: /tmp/launch-tK7iUz/Listeners Apple_PubS: /tmp/launch-SmQdNX/Render TMPDIR : /var/folders/F9/tmp/ USER : dharry VERSIONER_: 5.10.0

You can also set certain variables like LOGDIR.

Cheers

Harry

Update

Missed something the first time I read the post.

When i try to invoke the xinclude parser, it is not able to access the file even though i initialize the variable with a pre-determined path.

Does the variable contains what you think it does? Does the parser throw an error? Try adding use warnings as well. At first glance I see no reason why it shouldn't work.