my $env = `csh -c 'source script.csh; env'`; foreach my $line (split("\n", $env)) { my ($key, $val) = split('=', $line, 2); $ENV{$key} = $val; }