Well, I explained in the other thread what the problem is. The example code treats $results as an array ref but the show_user method returns a hash ref. You should get the (to my mind, really very clear) warning "Not an ARRAY reference".
Which leaves us wondering why you're not seeing this warning when you clearly have use warnings in your code. My suspicion is that you're looking in the wrong place. All of the CGI scaffolding in your code makes me think that you're running this as a CGI program. Depending on which web server you're using and how it is configured several things can happen to warnings from CGI programs. The most common effect is that they are written to the web server error log. Did you look in there?
You can force warnings and errors to be written to the browser by adding the following line to your code:
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
But remember to remove it again before putting the program into production.
It's also worth pointing out that just because your code is a CGI program, there's no reason why you shouldn't run it from your command line in order to try it out. I never put a CGI program onto a web server without running it from the command line first.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||