#! perl -slw use strict; use threads; sub test { system qq[ c:/windows/system32/sort.exe test.dat > sorted.dat ]; open F, ' }; close F; print "Via backticks\n", `c:/windows/system32/sort.exe test.dat`; open F, "c:/windows/system32/sort.exe test.dat |" or die $!; print "Via pipe\n", ; close F; } async( \&test )->join;