fork download
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use Data::Dumper;
  5. my @array = (
  6. [1,'John','ABXC12132328'],
  7. [0,'John','ABXC12132322'],
  8. [0,'John','ABXC12132322'],
  9. [0,'John','ABXC12132322'],
  10. [0,'John','ABXC12132322'],
  11. [0,'John','ABXC12132322'],
  12. [0,'John','ABXC12132322'],
  13. [0,'John','ABXC12132322'],
  14. [0,'John','ABXC12132322'],
  15. [0,'John','ABXC12132322'],
  16. [0,'John','ABXC12132322'],
  17. [0,'John','ABXC12132322'],
  18. [0,'John','ABXC12132322'],
  19. [0,'John','ABXC12132322'],
  20. [0,'John','ABXC12132322']
  21. );
  22. my %uniq_helper = ();
  23. my @uniq_data = grep { !$uniq_helper{"@$_"}++ } @array;
  24. print Dumper(\%uniq_helper) . "\n";
  25. print Dumper(\@uniq_data) . "\n";
Success #stdin #stdout 0s 21056KB
stdin
Standard input is empty
stdout
$VAR1 = {
          '0 John ABXC12132322' => 14,
          '1 John ABXC12132328' => 1
        };

$VAR1 = [
          [
            1,
            'John',
            'ABXC12132328'
          ],
          [
            0,
            'John',
            'ABXC12132322'
          ]
        ];