parse response from system query - too many ways to do it 
Author Message
 parse response from system query - too many ways to do it

Reviewing the various scripts I've seen which need to issue a query to
the system (a query which is expected to return a number of similar
lines in reply) and parse the result, suggests that Perl has too many
different ways to do it ;-)

There's capturing the result from backticks and then iterating through
the lines of the result; there's opening a pipe from the command and
reading it as i/o; there's various different ways of handling the
result with while, foreach, etc.

What does the team think is the most Perl-ish way to handle this,
please?  (The result should be usable when taint checking is enabled.)



Tue, 01 Nov 2005 12:25:29 GMT  
 parse response from system query - too many ways to do it

Quote:

> Reviewing the various scripts I've seen which need to issue a query to
> the system (a query which is expected to return a number of similar
> lines in reply) and parse the result, suggests that Perl has too many
> different ways to do it ;-)

> There's capturing the result from backticks and then iterating through
> the lines of the result; there's opening a pipe from the command and
> reading it as i/o; there's various different ways of handling the
> result with while, foreach, etc.

> What does the team think is the most Perl-ish way to handle this,
> please?  (The result should be usable when taint checking is enabled.)

It depends on what you need to do.  It's all covered in:

perldoc perlopentut



Tue, 01 Nov 2005 16:34:08 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Any better ways of doing this ?

2. Query - searching for one word OR another (e-mail response)

3. Receive Authorize.NET AIM response from SSL port 443 and Parse

4. Receive Authorize.NET AIM response from SSL port 443 and Parse

5. Parse HTTP RESPONSE Headers Active Perl CGI

6. parsing canned response

7. read system response in CGI

8. Errors in HTTP/Response & LWP/Response

9. Parsing $query->param(s)

10. parsing query strings

11. parsing URL query strings

12. Parsing query strings

 

 
Powered by phpBB® Forum Software