Showing results for 
Search instead for 
Do you mean 

add checking

Occasional Contributor

add checking

[ Edited ]

deleted

2 REPLIES
Highlighted
Frequent Advisor

Re: add checking

One way to check the output of a system command is to run it in a Perl 'open' operation and filter on the output. For example:

 

my $fh;

my $cmd = "ls -1 /tmp";

if ( open( $fh, "$cmd |" ) ) {

  while( $fh ) {

    my $line = $_;

    # Process the $line content here...

  }

 

  close( $fh);

}

 

There's plenty of examples of this sort of operation on the web. But I'd suggest learning a little more about perl before you proceed.

Frequent Advisor

Re: add checking

[ Edited ]

I'm having some difficulty understanding you. What do you mean by "the UNIX command"? Do you want to pass an arbitrary command to the subroutine and have it executed?