Reading the other comments, it appears you do want the output.
Backticks will work well for this situation, but not the way you used them. Try:
$key = `$sxwbt_dms $item`
instead of the shell redirection.
This runs the entire program, and then gives you all the output.
If your program would do well reading the output line by line as the program outputs it, you will get a faster response with an open call. Just follow the program name with a pipe character, and perl will attach to the program's STDOUT.
open(SWBT, "$swbt_dms $item |")
while(<SWBT>) {
process_line($_);
}
But that depends on if you need the entire results, or you want to process it line by line.
It is just yet another way to read output from a program, but since it hasn't yet been mentioned, and has the advantage of line-by-line processing, I thought I'd mention it.
~J
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.