Skip to content

Instantly share code, notes, and snippets.

@sugar84
Created November 15, 2011 12:15
Show Gist options
  • Select an option

  • Save sugar84/1366936 to your computer and use it in GitHub Desktop.

Select an option

Save sugar84/1366936 to your computer and use it in GitHub Desktop.
fork and filehandles in perl
perl -E 'open my $x, "<", "test.tmp" or die; seek $x, 10, 0; if (my $child = fork) { waitpid $child, 0; say "Parent: child exited, pos: " . tell($x) } else { ; say "Child: after read from file, pos: " . tell($x) }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment