Thank you once again for the explanation! I still though have some unclear parts which i dont understand.

When i do this:

my $counter = 'SELECT pagecounter FROM counters WHERE pagename = ?' +, undef, $pagename;
I'm actually expecting one single item for return and NOT an entire array. For example iam expecting 1 filed only (pagecounter that is) that will hold lest say number 75. This is one number so it seems logical to me to store it on a single variable, so i dont get why the baove aint working.

In your response you are saying and semantically (assigning that list to the $counter variable isn't going to help you get the counter from the DB, is it?): Why you say list? i think iam expecting an item only not a bunch of items(list)

Also:

my ($counter) = $db->selectrow_array( 'SELECT pagecounter FROM counters WHERE pagename = ?', undef, $pagename);
If for some reason we expect an array why doesn't the following code work as well? I'm considering that 'list' and 'array' are the same thing, both are a bunch of values, right?:
my @counter = $db->selectrow_array( 'SELECT pagecounter FROM counters WHERE pagename = ?', undef, $pagename);
What exactly is the difference between ($counter) and @counter ?

And the last thing is that i dont understand although you tried to expalin it to me the use of method 'selectrow_array'. Is it really necessary to tell it we are grabbing an array? doesn't the 'select' do this by its own?

As you can see i'am really confused....

ps. When i want to print variable counter i do 'print $counter' or 'print ($counter)' ?


In reply to Re^10: Making an automatic counter adder for all webpages by Nik
in thread Making an automatic counter adder for all webpages by Nik

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.