I have a perl array like below and I have to extract the unique elements of this array. Is there an easy way to do this ?
Perl> print(Dumper(@uncurled_data))
$VAR1 = '100 200';
$VAR2 = '100 200';
$VAR3 = '300 400';
$VAR4 = '100 200';
$VAR5 = '100 200';
$VAR6 = '300 400';
$VAR7 = '300 400';
$VAR8 = '300 400';
When I do this, keys { map { (split /\ /, $_)[0] => 1 } @uncurled_data }, I'll have to do it twice ie, once for each element in the array. Is there any one/liner or simple way to do this ?
Desired output array with 4 elements 100, 200, 300, 400