more useful options | |
PerlMonks |
Re: DB search results using DBI...executeby huck (Prior) |
on Mar 04, 2017 at 21:44 UTC ( [id://1183674]=note: print w/replies, xml ) | Need Help?? |
result First, $#arr returns the index of the last element, not the count. Second all you ever return from sql_execute is a scalar, it may be a hashref, or a arrayref, or a number but it is always a scalar. Third, in my @results = search_item($dbh, \@users, $st, $sv) . "\n"; you force scalar mode with the . for concatenation, and the "\n" gets placed into the @results array appended to scalar result as its only item. Fourth, you never showed us search_item so i am just sortof guessing but if search_item actualy did return an array the size of the array would be concatenated with the "\n" since scalar context was forced Edit: added "index of the" to "returns the index of the last element"
In Section
Seekers of Perl Wisdom
|
|