![]() |
Remove repetitions in Array
The normal idea is to have an hash table, iterate over the array and using the elements as keys.
Something like ::( Code: PERL
Code: PERL
Code: PERL
Code: =PERL
|
Re: Remove repetitions in Array
That's really cool! :D
|
Re: Remove repetitions in Array
This post has become a Recipe at my new Perl website.
http://sites.google.com/site/oleberp...n-free-array-1 |
Re: Remove repetitions in Array
Remove repetitions in Array without loop
Code:
my @array = (1,5,3,7,9,1,4,5,7,6,7); |
Re: Remove repetitions in Array
So, What did you add to the subject msmani_1980?
|
Re: Remove repetitions in Array
I couldn't get this line in the 3rd code block
@hash{@array} = (); hash is defined with % in the previous line (%hash) and then it is seen with @ which is meant for array. Can somebody explain me, what exactly "@", prepended to hashname, does? |
Re: Remove repetitions in Array
"@", prepended to hashname means we are accessing a hash slice i.e. a group of elements instead of one element a time.
|
| All times are GMT +5.5. The time now is 02:48. |