#!/usr/local/bin/perl use strict; use warnings; $ENV{foo}="bar"; if (fork == 0){ #child exec("./foo.pl"); } else{ print "I'm the parent $ENV{foo}\n"; }