in reply to array problem

First off: are you sure the qx() operator returns separate items for output?

You haven't inserted anything between the array items (except the default spaces). You're supposed to insert "</td><td>" between the cells. The easiest way to get that effect is

local $" = "</td><td>";

p.s. You should fix your tags, you don't have closing "<td>" and "<tr>" tags, but opening tags instead. And you might reconsider escaping the special HTML characters in your data, especially "<" and "&".

Replies are listed 'Best First'.
Re: Re: array problem
by bory (Beadle) on Sep 12, 2003 at 12:54 UTC
    i typed wrong, i have closing operators but i am not sure if qx returns separate items for output! I relly don't think so! Do you know any quotelike operators that returns separate items for output! Thank you for your time!!
      Check out perlop, where it says about qx() (or backticks, ``, which most of us will be more familiar with):
      In list context, returns a list of lines (however you've defined lines with $/ or $INPUT_RECORD_SEPARATOR), or an empty list if the command failed.
      By default, that is a newline. So the list returned contains one item per line. The question remains: does your command line return a multiline result? I'm not familiar with what you try to do, so I can't tell.

      You can easily test in two ways:

      • @a = qx(COMMANDLINE); print scalar @a;
      • $a = qx(COMMANDLINE); print "<plaintext>$a";
      The former will print the number of items, the latter will make the browser display the text as plaintext, line wrapping an all.

      I just hope that yo ucan tweak your command line so that you can get separate lines for the returned items. If not, you can set $/ to whatever string separates the data items.