Forum Discussion

Chad_Roberts_21's avatar
Chad_Roberts_21
Icon for Nimbostratus rankNimbostratus
Nov 28, 2006

Dash 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

2 Replies

  • 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}

    Give that a shot and see if it works for you.

    -Joe
  • 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.