#!/usr/bin/perl -w use strict; my $pid = fork(); if ($pid == 0) { # This is the child process. # exec() the external program. exec("my_program") or die "could not exec my_program: $!"; } elsif (!defined($pid)) { die "could not fork"; } # Everything below here is the parent process print "This is the parent process\n";