print "#Finished setup of two arrays $i x $j\n"; #Using system() print '#After - using system("date");: '; system("date"); if ( $? == -1 ) { print " #command failed: $!\n"; } else { print " #exited with value (\$? >> 8) = ",($? >> 8),"\n"; } print "# "; system("date"); if ( $? == -1 ) { print " #command failed: $!\n"; } else { print " #signal number (\$? & 127) = ",($? & 127),"\n"; } print "# "; system("date"); if ( $? == -1 ) { print " #command failed: $!\n"; } else { print " #dumped core (\$? & 128) = ",($? & 128),"\n"; } #Using backticks $cmd = `date 2>&1`; print "#After - using backticks: ",$cmd; #Using open() open(CMD, "date 2>&1 |"); $result = ; print "#After - using open: $result\n"; close(CMD); print "\n#End\n"; exit;