in reply to Re: assign variable and shift array
in thread assign variable and shift array

Alternatively, shift before forking.
my $file = shift(@fileArray); my $pid = fork(); ...