Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I've been banging my head against a wall trying to figure out a problem I first raised here. I have tried eval and some hairier possibilities, but nothing got me the errors/warnings coming from java command line tools like Xalan and FOP . Was it Java, Perl or me? Of course, it was stupid little me.

I figured it was time to take the dive (leap of faith?) into Interprocess Communications and follow tilly's advice. I settled in with dread and excitement to read Lincoln Stein's new book Network Programming with Perl. On page 43 my eyes popped out of my head, when I read, "On UNIX systems, you can use the Bourne shell's output redirection system to combine the subprocess's standard error with its standard output like this: $ls_output = `ls 2>&1`; Now $ls_output will contain both the standard error and the standard output of the command." Thank you Lincoln Stein for that gem (2>&1), that removes a few barriers I've been chipping away at for a few weeks now. I was fearing I was going to have to adopt an all Java solution, which would suck. But alas, Perl (and its community) comes through again.

I'm going to work on some applications with this and post them to the snippets section. Do you see any warning flags with this kind of solution? I'd also like to know if any of you have experience suggesting additions to the perldocs. If this gem had been there and in the right place(s) I would have saved hours of development time.

Get Strong Together!!

Edit: chipmunk 2001-05-15


In reply to redirecting standard error with backticks by aardvark

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-23 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found