Help for this page

Select Code to Download


  1. or download this
    $x = `echo foo`;
    
  2. 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";
    
  3. or download this
    $ perl t.pl
    Let's do a command:
    ...
    Now let's see what we captured:
    <foo
    >
    
  4. or download this
    print $x;
    
  5. or download this
    my @results = `command`;
    
  6. or download this
    my @foo = grep /foo/ @results;
    
  7. or download this
    if (0 == @foo) {
        print "The command didn't find 'foo'\n";
    ...
    else {
        print "Found 'foo'!\n";
    }
    
  8. or download this
    # Do the thing
    my @results = `command`;
    ...
    else {
        print "Found 'foo'!\n";
    }