Sure, it is not oo in style, but it can be easier to maintain.$state = 'initial_state'; while ($state ne 'completed') { if ($state eq 'state1') { #do something $nextstate = 'another state'; } if ($state eq 'state2') { # and so on } $state = $nextstate; # so we don't confuse our logic }
In reply to Re: CGI coding style
by Maclir
in thread CGI coding style
by 2501
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |