Forum Discussion
Chad_Roberts_21
Nimbostratus
Nov 28, 2006Dash in a data group list name
I recently wrote a few rules which referenced new data group lists, and things bugged out on me. (That's what I get for slapping new iRules into production without full testing, confident in my understanding of iRule logic. D'oh!) After some frustration and head-smacking, I realized that the log entries' "no such variable" references only mentioned the variable names up to the dash.
Why, then, am I even able to put a dash in the name at all?? Is this a bug, or is there a reason for it to be allowed which I am completely missing here.
Thanks,
dbw
- Dashes in variables is allowed, but you need to enclose them in curly braces. Underscores are ok but TCL interprets the dashes as a special character and terminates the variable at the dash. To bypass this surround the name with curly braces.
$::{data-group-name}
- Chad_Roberts_21
Nimbostratus
Well that figures. heh Too late now, as I've rewritten them all in order to get everything working immediately, but thanks for explaining it to me.
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