Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Seek one liner for distributing an integer

by davido (Cardinal)
on Sep 22, 2004 at 07:20 UTC ( [id://392859]=note: print w/replies, xml ) Need Help??


in reply to Seek one liner for distributing an integer

Yet another way...

use strict; use warnings; use Data::Dumper; my @array=qw(a b c d e); my $num = 13; my %result; $result{do{my$v=shift@array;push@array,$v;$v}}++while$num--; print Dumper \%result;

Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://392859]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-03-28 08:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found