in reply to Can someone Explain 2 lines of code
I know it's removing the duplicate values in an array
No, it isn't.
It is creating a hash called %count where the keys are the stringified values in the array @Clec_id and the values are the number of occurrences of each array value. Then it is printing the keys and values of that hash.
It may be true that keys %count contains the values of the original array with duplicates removed but not guaranteed. For instance, if the array contains references, they won't exist as keys in the hash; only their stringified representation will. Also, the keys of the hash are unlikely to be returned in the same order as the values of the array.
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Can someone Explain 2 lines of code
by Anonymous Monk on Oct 28, 2003 at 20:16 UTC | |
by sauoq (Abbot) on Oct 28, 2003 at 20:22 UTC | |
|
Re: Re: Can someone Explain 2 lines of code
by pg (Canon) on Oct 28, 2003 at 20:19 UTC | |
|
Re: Re: Can someone Explain 2 lines of code
by QM (Parson) on Oct 28, 2003 at 20:22 UTC |