Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Pipe processes and Perl subroutines together

by repellent (Priest)
on Feb 25, 2008 at 03:47 UTC ( #669925=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    &{
        bg exe sub { "2>#" }, qw( ls  /tmp  does_not_exist ),
    ...
           exe qw(cat -n),
           exe sub { print "six> $_" while <STDIN>; print "5th cmd: @_\n" 
    +},
    };
    
  2. or download this
    { ls /tmp does_not_exist 2> /dev/null | tac | [perlsub] | { sort | cat
    + -n | [perlsub] } & } &
    
  3. or download this
    exe &PREEXEC, LIST, &READER
    exe &PREEXEC, &READER
    exe &READER
    
  4. or download this
          "2>null"    # silence  stderr
          ">#"        # silence  stdout
          "2>&1"      # redirect stderr to  stdout
          "1>&2"      # redirect stdout to  stderr
          "1><2"      # swap     stdout and stderr
    
  5. or download this
    bg &BACKGROUND
    
  6. or download this
    package IPC::Exe;
    
    ...
    }
    
    'IPC::Exe';
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2023-06-07 10:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (29 votes). Check out past polls.

    Notices?