in reply to Re: Link Tracker
in thread Link Tracker

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

Replies are listed 'Best First'.
Re: Re: Re: Link Tracker
by graff (Chancellor) on Sep 13, 2003 at 22:59 UTC
    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).