i need a help in executing a for loop... the output should be in the form as below

1234
123
12
1


how to do it..
im new to learn PERL language