use strict; if (@ARGV){ print $ENV{PLATFORM}, $/; exit; } while(){ chomp; my ($variable, $value) = split '='; $ENV{$variable}=$value; } system("perl", $0, "test"); __DATA__ PLATFORM=abcdef