Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); print header(); #######test 1 my @dates = qw(02/01/2009 01/31/2009 01/01/2009 01/31/2009 02/20/2009 02/20/2009 02/20/2009 02/20/2009 02/01/2009 ); my %count = (); my $c=0; foreach my $date (@dates) { $c++; $count{$date}++; print "<font size=1>$c</font> - $count{$date} - $date<br>\n"; }
4 times 02/20/2009 2 times 02/01/2009 2 times 01/31/2009 1 times 01/01/2009
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Print about all elements of the array.
by GrandFather (Saint) on Feb 24, 2009 at 04:00 UTC | |
|
Re: Print about all elements of the array.
by hbm (Hermit) on Feb 24, 2009 at 03:42 UTC | |
by Anonymous Monk on Feb 24, 2009 at 03:46 UTC | |
|
Re: Print about all elements of the array.
by apl (Monsignor) on Feb 24, 2009 at 13:35 UTC | |
by Anonymous Monk on Feb 24, 2009 at 15:39 UTC |