Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

The Uniqueness of hashes.

by injunjoel (Priest)
on Sep 25, 2005 at 02:37 UTC ( #494836=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    perl, v5.8.0 built for MSWin32-x86-multi-thread
    
  2. or download this
    #!/usr/bin/perl
     
    ...
        print "\n";
    }
    
  3. or download this
    
    my @array1 = (1 .. 20);
    ...
    '21','22','23','24','25','26','27','28','29','30',
    '31','32','33','34','35','36','37','38','39','40']
    
  4. or download this
    
    my %unique_sets;
    ...
      '40' => [40]
    }
    
  5. or download this
    
    my %unique_counts = do{ 
    ...
      '40' => 1
    }
    
  6. or download this
    
    my %duplicates = do{
    ...
      '29' => 2,
      '30' => 2
    }
    
  7. or download this
    
    my %non_duplicates = do{
    ...
      '40' => 1
    }
    
  8. or download this
    
    my %unique_descriptive = do {
    ...
    }
    
    
  9. or download this
    
    my %max = do{
    ...
      'count' => 3,
      'values' => [20,20,20]
    }
    
  10. or download this
    
    my %min = do{
    ...
      'count' => 1,
      'values' => [40]
    }
    
  11. or download this
        shift @{[ 
            map{$_->[2]} 
            sort{$a->[0] <=> $b->[0] || $a->[1] <=> $b->[1]} 
            map{[$_{$_}->{count}, $_, $_{$_}]} keys %_ 
            ]}
    
  12. or download this
    ... = do {
            local %_ = %unique_descriptive;
    ...
                sort{ $_{$a}->{count} <=> $_{$b}->{count} || $b <=> $a} ke
    +ys %_ 
            ]}}};
    };
    
  13. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    print OUTPUT, $d{$_}."\n" for(sort keys %d);
    close OUTPUT;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://494836]
Approved by planetscape
help
Chatterbox?
[james28909]: no matter how i prepare the paths. oh well. looks like ill just have to start wsl perl from scratch
[Corion]: james28909: You can get a list of all modules on your Windows Perl via the autobundle command in the cpan shell. But that likely lists many more modules than you actually want. I recommend a clear separation and installing modules on ...
[Corion]: ... both Perls separately. I use cpanfiles or Makefile.PL for that - listing all modules for an application there allows me to install them via cpanm . or cpan . automatically without any further interaction

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2018-05-23 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?