Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Any tips on this?

by Eily (Curate)
on Feb 04, 2014 at 17:03 UTC ( #1073443=note: print w/ replies, xml ) Need Help??


in reply to Any tips on this?

Well you need a while loop indeed (or rather, a while loop is the obvious way to do it). Just write while instead of if, and do think about changing the value of $initial_number (maybe change its name) to give it the value of $new_number at the end of the loop. There's no else with a while loop.

And since this is very basic perl, you may want to read perlintro


Comment on Re: Any tips on this?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2015-07-06 21:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls