Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by blazar (Canon)
on Oct 11, 2008 at 10:10 UTC ( #716580=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    map (sub { "1" x $_ }, (1..10));
    
  2. or download this
    C:\temp>perl -E "say for map sub {1 x $_} => 1..3"
    CODE(0x182a944)
    CODE(0x182a944)
    CODE(0x182a944)
    
  3. or download this
    C:\temp>perl -E "say for map { my $x=$_; sub {1 x $x} } 1..3"
    CODE(0x23aa7c)
    CODE(0x182aef4)
    CODE(0x182ad74)
    
  4. or download this
    C:\temp>perl -E "my $_; say for map sub {1 x $_} => 1..3"
    CODE(0x23a97c)
    CODE(0x182a9bc)
    CODE(0x183bbbc)
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (14)
As of 2015-07-06 12:43 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 (74 votes), past polls