Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I've put all sorts of general comments on the code below. I can't find your specific error, but following these style tips should help you find it yourself, or be more likely to get help in the future.
Use perl -w to turn warnings on. Include "use strict;" to enforce variable declaration. See perlstyle for tips.
There is no real reason to use chop()...get in the habit of using chomp(), and use chop() only when you really mean it.
I realize this has been commented out, but you should not have to use goto. A case can be made for when to use goto, but given perl's great flexibility in flow-control, you can plan to never use it and be fairly safe.
You should always report error conditions on file opens. Try : open(NAMEONED, $onedname) or die "Can't open $onedname: $!";
When posting code and asking for help, remove all useless, commented out lines.
This is somewhere where a goto is unnecessary. Look up line labels, next and last in perlman:perlsyn In reply to Re: debug the error!!!
by swiftone
|
|