in reply to Re: Re: Link Tracker
in thread Link Tracker
(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).
|
|---|