Forum Discussion
Josh_B_152229 Nimbostratus
Nimbostratus
May 20, 2015Calling procs dynamically
 I have successfully tested calling procs like this: 
   eval call [string tolower {HTTP::host}]::procName   
 However, I'm trying to stop using HTTP::host directly because the TCL checker freaks comp...
Josh_B_152229 Nimbostratus
Nimbostratus
May 21, 2015Much progress has been made. What I found is incredibly frustrating, but I assume it's because I was (somehow) "doing it wrong."
The goal was to dynamically call a proc named
http_request[HTTP::host]eval call [$variable]::procNameAs indicated above, the variable substitution must not act how I think it should and the following not only does not work, but also crashes TMM on 11.6.0 HF3:
set host [string tolower [HTTP::host]]
set uri [string tolower [HTTP::uri]]
eval call [string tolower {HTTP::host}]::http_request $host $uri
My initial testing shows that defining the entire proc to call as a
string$host[string tolower [HTTP::host]]http_requestset host [string tolower [HTTP::host]]
set uri [string tolower [HTTP::uri]]
set http_request  "[string tolower [HTTP::host]]::http_request"
eval call $http_request $host $uri
- Josh_B_152229May 21, 2015Nimbostratus Update: The last line also works when passing TCL words instead of the variables like so: `eval call $http_request [HTTP::host] [HTTP::uri]` As "expected" as that is, it's exciting to me because I have seen so much unexpected behavior with variable substitution lately.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects