#!/usr/bin/perl use v5.14; use warnings; use Win32API::File 'FdGetOsFHandle'; my $FILE = shift or die "Need file to read\n"; say "Opening file"; open( my $in, '<', $FILE ) or die "Can't open '$FILE': $!\n"; # Get the real FD from Windows my $fd = FdGetOsFHandle( fileno($in) ); say "Spawning child process"; my $pid = system(1, 'perl', './fd_get.pl', $fd ) or die "Could not spawn child process: $!\n"; wait;