in reply to problems with the "switch" module
Your use for Switch.pm could be done as well with a dispatch table. That is a hash of code references, like so,
Your functions should take arguments and return values, rather than modifying global variables, but I didn't know enough about your app to change that.my %dispatch = ( SQUID => sub { $web_proxy = $proxy_address; }, EZPROXY => sub { if ($proxy_credentials){ ($user_name, $password) = split /\//, $proxy_credentials; $prefix = $proxy_address."user=$user_name&pass=$password& +url="; } else { $prefix = $proxy_address."url="; } } ); $dispatch{$proxy_type}->();
CountZero++ is right, repaired. Paste confusion.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problems with the "switch" module
by CountZero (Bishop) on Jul 10, 2006 at 18:20 UTC |