use strict; use warnings; use Win32::Socketpair qw[ winopen2 ]; ## Run the command and get a bi-direction pipe to it. my $pipe = winopen2( 'PwrUsbCmd.exe 0 0 0' ); my @results = <$pipe>; print $pipe "\n"; print @results;