#!/usr/bin/perl use strict; use warnings; my $var; my $pid = fork(); $var++; waitpid( $pid, 0 ); print "$var\n" if ( $pid );