Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Five digit number display separately

by choroba (Chancellor)
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).

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

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 romping around the Monastery: (10)
As of 2016-08-25 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (360 votes). Check out past polls.