#!/usr/bin/perl use strict; use warnings; my $pid = fork; if ((defined $pid) && ($pid == 0)) { exec("sleep 30 >> /dev/null 2>&1 &"); exit; } print "child pid [$pid]\n"; #### $ perl tst.pl child pid [23367] $ ps ax | grep sleep 23368 pts/7 S 0:00 sleep 30 23371 pts/7 S+ 0:00 grep --colour=auto sleep