print "insert 5 digit number:\n";
$string = <STDIN>;
for ($i=1; $i<=5; $i++)
{
$var = substr($string,$i-1,1)
Print "$var\n";
}
For this i am getting output as:
1
2
3
4
5
someone help me out i am new to perl
i need output as
1
22
333
4444
55555
Comment on Re^2: Five digit number display separately
You are almost there. The only thing missing is to repeat each digit. For that, you can include another loop, or use the repetition operator as adviced in my first reply to your question.
Also, please use <code> ... </code> tags for code and data samples to improve readability.