#!/usr/bin/perl -w if ($pid = fork) { print "1. in pid $$\n"; waitpid($pid,0); } else { print "2. in pid $$\n"; }