http://www.perlmonks.org?node_id=1027200


in reply to Re^7: Get just the unique value
in thread Get just the unique value

Sure, the end result is that $data only holds the unique values: From this:
my $data = [ { 'type' => 'Paper' }, { 'type' => 'Paper' }, { 'type' => 'Plastic' }, { 'type' => 'Plastic' }, { 'type' => 'Plastic' }, { 'type' => 'Plastic' }, { 'type' => 'Cotton' }, { 'type' => 'Cotton' }, { 'type' => 'Cotton' }, { 'type' => 'Cotton' }, { 'type' => 'Cotton' }, { 'type' => 'Paper' }, { 'type' => 'Paper' }, { 'type' => 'Paper' }, { 'type' => 'Paper' }, { 'type' => 'Paper' }, ];
To that:
$data = [ { 'type' => 'Paper' }, { 'type' => 'Plastic' }, { 'type' => 'Cotton' }, ];