# one way: my $content = `other_script`; die "No output from other_script" unless ( $content ); # another way: open( SCR, "other_script |" ) or die "other_script failed: $!"; print while (); close SCR; # the only other way: my $tmpfile = function_returning_uniq_name(); my $status = system( "other_script > $tmpfile" ); die "other_script failed" if ( $status or -s $tmpfile == 0 ); open( TMP, $tmpfile ) or die "WTF?? can't open $tmpfile: $!"; print ; close TMP: unlink $tmpfile;