foreach (@files) { open(EP,$_); $pid = fork(); if ($pid == 0) { print "\nI just opened $_\n"; while () { chomp; print "Contents of this file: $_\n"; } } else { print "This is the parent process\n"; } } print "\n";