I was tryingmy %histogram; $histogram{$_}++ for @list;
but above actually prints out the reference address. I tried few different things but does not print out the actual value.. can someone give me a pointer on this(no pun intended).. thanks. for example like below....foreach (@data1) { $hist{$_}++ for $_; } my @uni = keys %hist; print "@uni\n";
#!/usr/bin/perl -w use strict; use warnings; use Data::Dumper; my $ref = { a => { A => 1, B => 2, C => 3}, b => { D => 1, E => 2, F => 4}, c => { G => 2, H => 1, I => 2}, }; #print Dumper($ref); my %hist; foreach ($ref) { $hist{$_}++ for $_; } my @uni = keys %hist; print "@uni\n";
In reply to Re^2: perl sort issue while going through article at perl.com
by convenientstore
in thread perl sort issue while going through article at perl.com
by convenientstore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |