Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re (tilly) 1: What Happened...(perils of porting from c)by tilly (Archbishop) |
on Jan 05, 2001 at 18:09 UTC ( [id://50061]=note: print w/replies, xml ) | Need Help?? |
I went and looked. First of all I strongly suggest using strict up at the top, it will catch even more errors for you. Of course you need to use vars as well. After that fixing it to work is just a matter of walking through and fixing complaints. You have an extra ')' before a ||. One-line for loops need to either change the format or need the braces. There are a few undeclared variables. A few more cases where // is used instead of # for a comment. A few $ missing. (ie You want --$level rather than --level.) Your final return statement should not be there. All of this is pretty mechanical, but I am loathe to post the final result since the resulting code is very ugly. A native Perl version of this would be easy to write and would look much nicer. Perhaps if I get some time...
In Section
Seekers of Perl Wisdom
|
|