This now works but originally the use lib was worded differently - use lib "$ENV{SECTRAN_DIR}/lib" ; This generated a compilation time error. Is this because the use lib is parsed at compile time and the SECTRAN_DIR variable is created at run time and therefore doesn't exist when the use lib is evaluated? Just trying to clear this up in my head. Cheers, Ronnie#!/usr/bin/perl -w # use strict ; # sub get_login_env { local %ENV; my $shell = shift || (getpwuid($<))[8]; my $env = `echo env | perl -e 'exec {"$shell"} -sh'`; if (wantarray) { my @pieces = ($env =~ m/^(.*?)=((?:[^\n\\]|\\.|\\\n)*)/gm); s/\\(.)/$1/g foreach @pieces; return @pieces; } else { return $env; } } # ############################################################### # Set up variables # ############################################################### # my $ftpfile = 'mailtest.pl' ; my $out_file = 'ronniesrubbish' ; my $result = 0 ; my $key = undef ; my $value = undef ; # print "\n\t\t<***** xxrcenv Starts *****>\n" ; # %ENV = (%ENV, get_login_env()); # while (($key, $value) = each (%ENV)) { print "\n\tKey :: $key" ; print "\n\tValue :: $value" ; } # print "\n" ; # use lib '/home/interface/sectran/lib' ; #use lib "$ENV{SECTRAN_DIR}/lib" ; foreach (@INC) { print "\t$_\n" ; }
In reply to UNIX/profile the sequel by Ronnie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |