dlg_23340
Nov 18, 2011Cirrus
variables in a switch statement
What are my options for variable expansion in switch cases? It seems to me that in the following code, when i visit http://example.com/bar/test, I should get "you found foo." for my page content. In practice, this isn't the case. What do I need to do to have the variable $foo expanded inside the switch?
Thanks.
when HTTP_REQUEST {
set foo "bar"
switch -glob -- [URI::decode [HTTP::uri]] {
"/$foo/*" { HTTP::respond 200 content "you found foo." }
}
}