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' }, ];

Replies are listed 'Best First'.
Re^9: Get just the unique value
by CountOrlok (Friar) on Apr 05, 2013 at 19:02 UTC
    hdb's code does exactly that, albeit sorted.