#!/usr/bin/perl use warnings; use IPC::Open3; #cdrecord sends a /r (no newline) to output status #so it is difficult to get output my $pid = open3(\*WRITE, \*READ,0,"/usr/bin/cdrecord -v -dummy -eject dev=1,1,0 my.iso"); #if \*ERROR is false, STDERR is sent to STDOUT while(1){ select(undef,undef,undef,.01); if( sysread \*READ,$output,1024 ){ print "$output\n"; }else{ print "finished\n"; exit; } }