On Wednesday, July 10, 2002, at 01:07 , Chris Knipe wrote:
[..]
> What I'd like to accomplish, is something in the lines of:
>
> if ($SiteType == "PHP3") {
> do some stuff
> } elsif ($SiteType == "PHP4") {
> do different stuff
> } elsif ($SiteType == "ASP") {
> do different stuff
> ....
> } else {
> do default stuff
> }
assuming that you learned from the
'==' != 'eq'
classical oopsie....
you might want to think about whether it is time
to adopt the
use Switch;
"DEPENDENCIES
The module is implemented using Filter::Util::Call and Text::Balanced
and requires both these modules to be installed.
"
or adopt a simple hash_of_sub strategy like:
### if ( exists($lookup_func{$SiteType})) {
### $response = $lookup_func{$SiteType}->() ;
### } else {
### $response = $lookup_func{'default_function'}->() ;
### print "invalid state info : $statefield \n";
### }
###
### print "$response \n";
cf:
http://www.wetware.com/drieux/pbl/misc/HashSwitch.txt
ciao
drieux
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]