Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: Generate the perl sequence 1, 11, 111, ....

by AnomalousMonk (Abbot)
on Oct 10, 2008 at 09:07 UTC ( #716396=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Generate the perl sequence 1, 11, 111, ....
in thread Generate the perl sequence 1, 11, 111, ....

... is it possible to write a perl subroutine that does the same thing, myPerlSub BLOCK LIST
Absolutely. See perlsub and in particular Prototypes.
>perl -wMstrict -le "sub mysub (&@) { my $coderef = shift; map $coderef->($_), @_; } my @out = mysub { $_ += 33 } 0 .. 5; print qq{@out}; " 33 34 35 36 37 38


Comment on Re^3: Generate the perl sequence 1, 11, 111, ....
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2015-07-02 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (33 votes), past polls