Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
To me the amount of comments in the code serve to make it less readable. If you need that many comments to allow people to understand your code perhaps you should rewrite the code to be more understandable. Use comments to explain why you did something and let the code should show how it's done. You write my %HoHoHoA; #used in readListOfFilesToSFTP() What does that serve to tell someone reading your code? I'm not sure what exactly but I am sure Santa Claus is somehow involved. You've defined two constants TRUE and FALSE which aren't used anywhere in the code that I see. Check this page for an explanation of why that's usually a silly thing to do. There are several blocks of code with a pattern of why not:
If looks like you are trying to see if put succeeds but in a really obscure way.. Does that work? From looking at the source, put returns undef on failure:
There are several areas where you are doing things like this: Why don't you make the writeLog function a little smarter rather than littering the code with all those checks for if (!debug) and if (! $interactive) maybe set up a closure so that the writeLog function knows what mode it is in and knows what to do with the messages it receives something like:
I see some system calls where the return value isn't being checked, bad idea. Anyway those are just some quick comments I had while reading down through your code, I didn't actually run it or check too hard for bugs. I think overall it could benefit from more design work upfront to make it more modular. Best of luck! In reply to Re: Seek Critique of SFTP program, format, structure, overall "Perl"ness
by daddyefsacks
|
|