Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: shell read of val

by roboticus (Chancellor)
on May 16, 2018 at 18:15 UTC ( [id://1214677]=note: print w/replies, xml ) Need Help??

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";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1214677]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 22:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found