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

Re: Five digit number display separately

by choroba (Canon)
on Sep 04, 2013 at 13:07 UTC ( #1052335=note: print w/ replies, xml ) Need Help??


in reply to Five digit number display separately

Sounds like a homework.

A one liner:

perl -ne 'print $_ x ++$i, " " for split //'

To understand, read print, split, perlvar (explains $_), perlop (explains x, ++, and //), perlsyn (explains for), and perlrun (explains -ne).

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Five digit number display separately
Select or Download Code

Log In?
Username:
Password:

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

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

    Who makes your decisions?







    Results (63 votes), past polls