use strict; use warnings; use File::Find; use File::Spec; use File::Path; use File::Copy; use File::Basename; use Cwd; my $scriptDir = cwd; #------------------------------------------ my $operatingSystem = $^O; my $windows = "MSWin32"; my $unix = "hpux"; print "Running under ${operatingSystem} environment.\n\n"; my $pathSeparator = ""; if ( $operatingSystem eq $windows ) { $pathSeparator = "\\"; } else { $pathSeparator = "/"; } #------------------------------------------ #execute the environment variables script if ( $operatingSystem eq $windows ) { system("$scriptDir/dosTest.bat"); } else { system("$scriptDir/unixTest.sh"); } #---------------------------------------------- $ENV{'ksENV'} = "c:/temp"; $ENV{'script_dir'} = "$ENV{'ksENV'}/bin"; my $someFile = "$ENV{'ksEnv'}/bin/someFile.txt"; open theFile, $someFile or die $!; while (my $record = ) { print $record; } close(theFile); print "\n$ENV{script_dir}"; print "\n$someFile"; print "\n$ENV{THIS_HOME}"; print "\n$ENV{thisRoot}";