I'm not even sure what you're doing. There's a few issues with the snippets you posted:
- In the while, you treat $entry as a number. Then, you treat it as a subroutine name. Do you have a bunch of subroutines named 1, 2, 3, etc?
- Assuming you mean $i = $entry * (2 / 3);, the code will never end.
- In the second snippet, you are doing a numeric check, then a string check. (< is numeric, ne is string.) While this will work (because both $i and $entry will be converted to strings and compared), it's better to do numeric checks if you're dealing with numbers.
I guess what I'm asking is - what on earth are you doing? What is $entry?
Oh - predicability has 2 't's in it. :-)
------ We are the carpenters and bricklayers of the Information Age. Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement. | [reply] [d/l] [select] |
I will confess that I am most confused. What you have is not valid syntax. Is there something you have left out of your code?
$ perl -MO=Deparse -e 'while ($i<$entry){$i = $entry (2/3)}'
syntax error at -e line 1, near "$entry ("
-e had compilation errors.
while ($i < $entry) {
;
}
Cheers,
Ovid
New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text) | [reply] [d/l] |
I think you must be mistaken. Maybe you should post the actual code.
Update:Is $i a number? I notice you are using ne in the second example which is for non-numeric data. Less-than will have interesting results if $i or $entry aren't numbers.
| [reply] |