Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2015-11-29 11:43 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (750 votes), past polls