C
ccc31807
Using 5.8 in a web app, I have about 18 elsif statements which look
similar to this:
elsif ($action eq 'AddAttorney')
{
print qq(<h4>Add Attorney</h4>);
HTML::add_professional($oprid, $role, 'Attorney');
HTML:rint_button('setup.cgi','Return To Setup',$oprid, $role);
}
elsif($action eq 'AddInsurer')
....
I now fact the prospect of adding some more, hopefully not many, but
I'm getting tired of looking at all of this.
Is there any way to mimic the case/switch statement? Ideally, I'd like
to have just the matching term for each block, like this:
'AddAttorney'
print qq(<h4>Add Attorney</h4>);
HTML::add_professional($oprid, $role, 'Attorney');
HTML:rint_button('setup.cgi','Return To Setup',$oprid, $role);
'AddInsurer'
...
It's not critical, but I'm just getting tired of looking at all the
repetition.
CC.
similar to this:
elsif ($action eq 'AddAttorney')
{
print qq(<h4>Add Attorney</h4>);
HTML::add_professional($oprid, $role, 'Attorney');
HTML:rint_button('setup.cgi','Return To Setup',$oprid, $role);
}
elsif($action eq 'AddInsurer')
....
I now fact the prospect of adding some more, hopefully not many, but
I'm getting tired of looking at all of this.
Is there any way to mimic the case/switch statement? Ideally, I'd like
to have just the matching term for each block, like this:
'AddAttorney'
print qq(<h4>Add Attorney</h4>);
HTML::add_professional($oprid, $role, 'Attorney');
HTML:rint_button('setup.cgi','Return To Setup',$oprid, $role);
'AddInsurer'
...
It's not critical, but I'm just getting tired of looking at all the
repetition.
CC.