Forum Discussion
smp_86112
Cirrostratus
May 04, 2010v10 - local vs. global vars
Trying to wrap my mind around how this variable scope works. I have a simple iRule I'm testing with:
when HTTP_REQUEST {
global client_local [TCP::local_port clientside]
if...
smp_86112
Cirrostratus
May 04, 2010I think you are getting too hung up on my example. My example was arbitrary - just a simple way designed to help me understand how to and where I can reference global variables, as opposed to local and static ones.
What is really bending my mind is this article: http://devcentral.f5.com/wiki/default.aspx/iRules/CMPCompatibility.html
"Note - demoted only if caught by validator--"global" keyword was not caught by validator (:: reference)"
1. I read this to mean I could define a global variable using the "global keyword" - hence "global client_local [TCP::local_port clientside]". Maybe that's wrong, and the only way to define a global variable is using the "$::client_local" syntax?
2. Is there really only two variable types - local and global, with the global sub-divided into two sub-types: CMP-compatible and non-CMP-compatible? That would make a lot more sense. The doc makes it sound like there are three types, but it only seems to provide examples on how to define two - static and local. I can't figure out where this third type fits.
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