- or download this
$x = `echo foo`;
- or download this
$ cat t.pl
use strict;
...
print "OK, command is done!\n\n";
print "Now let's see what we captured:\n<$x>\n";
- or download this
$ perl t.pl
Let's do a command:
...
Now let's see what we captured:
<foo
>
- or download this
print $x;
- or download this
my @results = `command`;
- or download this
my @foo = grep /foo/ @results;
- or download this
if (0 == @foo) {
print "The command didn't find 'foo'\n";
...
else {
print "Found 'foo'!\n";
}
- or download this
# Do the thing
my @results = `command`;
...
else {
print "Found 'foo'!\n";
}