Forum Discussion

VirtouZ_165395's avatar
VirtouZ_165395
Icon for Nimbostratus rankNimbostratus
Oct 13, 2015

warning: [variable reference used where variable name expected][${var}]

Hi All,

When performing a tmsh load sys config verify, I have the following warning message:

/Common/irule_reverse_proxy_v4.1:90: warning: [variable reference used where variable name expected][${var}] /Common/irule_reverse_proxy_v4.1:93: warning: [variable reference used where variable name expected][${var}] /Common/irule_reverse_proxy_v4.1:100: warning: [variable reference used where variable name expected][${var}] /Common/irule_reverse_proxy_v4.1:108: warning: [variable reference used where variable name expected][${var}]

The block responsible for these warnings in my iRule is:

89   foreach var { "do_host_rewrite" "do_requests_rewrite" "do_responses_rewrite" "rule_debug" }
90   {
91      set ${var} 0
92      if {[class search $datagroup equals $var]}
93      {
94         set ${var} [class match -value $var equals $datagroup]
95      }        
96   }

This is NOT https://support.f5.com/kb/en-us/solutions/public/14000/500/sol14531

I tried the iRule with different version (11.6.0, 11.5.3 etc.)

Is there something wrong with my syntax?

Thank you in advance for your help,

Regards,

1 Reply

  • Hi Vitouz,

    the right set command is:

    set var 0
    

    or

    set var [class match -value $var equals $datagroup]
    

    the

    $
    is to get value of the variable, not to set it.