If you have a flow control statement (next, last, return, exit, ...) at the end of an if block, you don't need to follow the block with an else block which saves a level of indentation for the following code. I tend to call the technique "early exit". Be warned however that some purists frown on the technique claiming that "things should only have one exit point". I use the technique a lot because I think it tends to clean up code something wonderful.
On a related note, if you change the sense of your if you don't need the next. For the resulting code see my earlier reply to the OP.
Note that you have duplicated the OP's error in using ne in place of ==. On a related note you shouldn't quote the 9 in the assignment to $planet_count - a count is generally a number not a string after all.
In reply to Re^2: Help using a while loop with STDIN
by GrandFather
in thread Help using a while loop with STDIN
by amonline
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |