i.e. have an empty block attached to an if, elsif or else. It might sound like an odd question, but I don't want to put undefined behaviour into my program by breaking some obscure rule. Any advice appriciated.
Steven.
Last edited by Mushy-pea; Dec 16th, 2006 at 3:47 pm.
technically, as far as I know, it is OK. In general I would say it's not good practice unless it's clear why you needed to do that or put comments in the code explaining why you are doing that. Like in the CGI module you will see a sub routine that is just an empty block:
as the comment notes it's just there to avoid a warning message. In your case make sure it's really necessary, there is probably a better way to do whatever it is you are doing but can't tell by the sample code you posted.
Thanks Kevin. Actually, I have decided to release the application I am working on (perlBB) as open source software. So, if you want to have a peek at the code you can visit the project home page on Sourceforge (http://sourceforge.net/projects/perlbb ). The if....else construct I mentioned is in "sub update_list" in /perlbb_0_4/forum.pl.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.