my $rin = ""; vec($rin, fileno(STDIN), 1) = 1; my $isPiped = select($rout=$rin,"","",1); if($isPiped){ #Do the data processing from pipe }