in reply to Link Tracker

Yes. You are improving. Now if we could just convince you to indent your code! ;) As for this item:

$db{$url} = $value++; # post increment!
This indeed does increment $value, but after it's original value has been fetched and stored into $db{$url}. You could have used this instead:
$db{$url} = ++$value; # pre increment!
But Anonymous Monk's suggestion is much better.

Also, consider switching to HTML::Template (although i will commend you for at least using qq). It's really not that hard, and with the help of my tutorial you should be able to pick it up fairly quickly. (If you can work with DB files, you can handle HTML::Template! ;))

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: Re: Link Tracker
by sulfericacid (Deacon) on Sep 13, 2003 at 21:25 UTC
    I really appreciate everyone's comments on this and really really happy that I'm finally getting to the point where I can do a lot of things on my own.

    The ++$var will come in handy real quick, I ran into the same "not incrementing" problem with my banner rotator. Thanks for that bit of info..

    As for $db{ $var } ++; that's amazing. They sure did make it easier for the lazy people to do pretty mcuh everything :) I wish Anonymous Monk signed in so I could ++ him/her, that's a really quick and short way of incrementing a hash key. I didn't test this out but I was wondering if you could increment both the key and value at the same time? $db{$var1}++ = ++$value;

    Sorry about the indenting Jeffa, I do intent now! It's just my computer isn't working so I'm on a system without ActivePerl (without perltidy). I will read/print/read/read/read your tutorial Jeffa :) If this helps with creating forms and tables I'll rake your leaves and shovel your snow all winter!! :)

    Thanks again for all your comments/suggestions everyone, it really helps knowing other people can tell the difference in your codes.

    "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

    sulfericacid

      I didn't test this out but I was wondering if you could increment both the key and value at the same time? $db{$var1}++ = ++$value;

      (1) If you are using incremental values as hash keys, then you should probably be using a plain array instead.

      (2) Yes, you can increment the array index (or key) and the value in one statement. The correct way would be: $db[$index++] = ++$value (or similarly with a hash key, if you insist), whereas your initial guess (with "++" outside the brackets) is not allowed; it generates a compile-time error.

      Go ahead, try it yourself and see. Your guess is "logically" equivalent to:  $j++ = ++$i (I'm glad perl treats this as an uncompilable coding error).