Forum Discussion
Robert_Reznicek
Nimbostratus
Apr 15, 2010Assigning array to another array
Hello, is it somehow possible to fill one array (temporary) and then assign this whole array to another array? I would need to do something like this:
set tempArr(x1) "valueA"
set tempArr(x2) "va...
Robert_Reznicek
Nimbostratus
Apr 19, 2010Thank you guys, this is exactly what I needed to know.
I don't have any performance issues with reading of the entries from the external datagroup, but there is limitation with processing of the entries, so I'm forced to create loop, which is searching for best match. This is slowing down the whole process.
The datagroup has this format:
external_host1/path1 internal_host1 node_IP
external_host1/path2/levelX internal_host2 node_IP
external_host1/path3 internal_host3 node_IP
I need to compare URL with all entries from this file (1st field) and to find best match. When using loop lsearch the performance is poor so we are using multidimensional array, where the first field acts as key name and the rest of the line as it's values. When using this method, the performance is much better:
...
set url_host [HTTP::host]
set url_path [URI::path [HTTP::uri]]
...
set url $url_host$url_path
...
if {[info exists ::ppass($url)]} {
log local0. "DEBUG: Found"
set line $::ppass($url)
} else { ...
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