Hmm, okay, you're using a database query method I'm not familiar with to get your array. If you were using something like:

while (my @row = $sth->fetchrow_array){@search=($row[2]);}
I'd understand a bit better. You specify in other post that your query only returns one row in this case, but what does your array look like if your query returns more than one row?

So, you use my @currentpoll = LSRfm::Database::Data->search(field => 'currentpoll'); to get your array. Does this technique fetch rows sequentially? If so, put your fetch into a loop and then use $row[2] to access the content field, pushing it into an array with push @search, $row[2] if you need to compile a list for your next function. Of course, you'll also be safe doing this if you're sure you'll always get one row (which is what the OP looked like), but in that case I'm not sure why you need the single field in an array (though you can still do it).

-----------------
s''limp';@p=split '!','n!h!p!';s,m,s,;$s=y;$c=slice @p1;so brutally;d;$n=reverse;$c=$s**$#p;print(''.$c^chop($n))while($c/=$#p)>=1;

In reply to Re: How to access an Array Element by SamCG
in thread How to access an Array Element by barrycarlyon

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.