Monks,
I have the following sub I wrote to remove duplicates from an array. I want to modify it so I can pass the array by reference and modify the contents of the referenced array. Thus benefits should be two-fold, saving of stack memory (handy for larger arrays) but also don't need to return a value as the actual passed array it modified.
Can anyone help me as I don't know how to do this. My original code it below:
____________sub util_remove_duplicates(@) { my %hash; undef %hash; @hash{@_} = (); return keys %hash; }
In reply to Removing Duplicates from Array Passed by Reference by arunhorne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |