$ cat t.pl use strict; use warnings; print "Let's do a command:\n"; my $x = `echo foo`; print "OK, command is done!\n\n"; print "Now let's see what we captured:\n<$x>\n";