Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: What I am missing here

by tobyink (Canon)
on Mar 20, 2012 at 21:31 UTC ( [id://960661]=note: print w/replies, xml ) Need Help??


in reply to Re^2: What I am missing here
in thread What I am missing here

Can go simpler...

sub deck_maker { map { my $suit = $_; map { "$_ of $suit" } 2..10, qw(J Q K A) } qw(spades hearts diamonds clubs); }
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^4: What I am missing here
by heatblazer (Scribe) on Mar 21, 2012 at 05:21 UTC

    Yes, I got that but I want to be more explicit of what is going on... my pick_a_card could be just :

    sub pick_a_card { pop; }

    but I prefer it my way

Re^4: What I am missing here
by tobyink (Canon) on Mar 23, 2012 at 22:44 UTC

    With List::MapMulti this can be reduced to:

    sub deck_maker { mapm { join " of ", @_ } [ 2..10, qw(J Q K A) ], [ qw(spades hearts diamonds clubs) ] }
    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (10)
As of 2024-04-23 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found