joec_ has asked for the wisdom of the Perl Monks concerning the following question:
Full list:
-------
Greg, 1111
Caroline,2222
Joe,3333
...
Edited lists:
-----------
Caroline, 2222
Joe, 3333
....
* Note removal of first element
-----------
Greg, 1111
Joe, 3333
....
* Note removal of second element
The code i have so far is:
#!/usr/bin/perl use strict; use warnings; my $range=8999; my $min = 1000; my @names = qw(Greg Caroline Joe Dom Mary Gerard Mark Clare Adam Damia +n Debbie Conor Cassie John Jane Mike); my %hash; foreach my $n (@names){ my $r = int(rand($range))+$min; $hash{$n}=$r; }
Any suggestions appreciated.
Thanks
Joe
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Print hash except first value
by ww (Archbishop) on Dec 21, 2008 at 02:31 UTC | |
by eye (Chaplain) on Dec 21, 2008 at 08:11 UTC | |
Re: Print hash except first value
by ikegami (Patriarch) on Dec 20, 2008 at 22:20 UTC | |
by xhunter (Sexton) on Dec 21, 2008 at 17:37 UTC | |
by joec_ (Scribe) on Dec 20, 2008 at 22:23 UTC | |
by ikegami (Patriarch) on Dec 20, 2008 at 22:25 UTC | |
by joec_ (Scribe) on Dec 20, 2008 at 22:34 UTC | |
by ikegami (Patriarch) on Dec 20, 2008 at 22:36 UTC | |
| |
by jwkrahn (Abbot) on Dec 21, 2008 at 03:52 UTC | |
| |
by swampyankee (Parson) on Dec 21, 2008 at 17:38 UTC |