Forum Discussion

tarsier_90410's avatar
Icon for Nimbostratus rankNimbostratus
Apr 11, 2011

foreach items in list - behavior change in 10.x?

I am trying to find information regarding a change in behavior in the way foreach acts on lists from 9.x to 10.x and cannot find any previous threads on the matter. Is this an intentional change or a bug, and is there a work around to achieve the 9.x behavior in 10.x?






set INFO {"1" "2" "3" "4" "5" "6" "7" "8" "9" "0" "a" "b" "c" "d" "e" "f"}


foreach {a b c d} $INFO {


log local0. "$a $b $c $d"










9.2.5 build 5.1 log output


1 2 3 4


5 6 7 8


9 0 a b


c d e f




10.2.1 build 297 log output


1 1 1 1


2 2 2 2


3 3 3 3


4 4 4 4




4 Replies

  • Interesting - this looks like CMP to me, but it's just a hunch. Does this happen to be a 4-way box? I ask because 9.2.5 has a single TMM instance, and 10.2.1 will have 4 on a 4-way box. A quick way to test this theory is to 'demote' the virtual server. Put something like this in:



    when RULE_INIT {


    set ::demote_me 1




    Which will set a global that will automatically demote that virtual and pin it to a single TMM instance. If you see your foreach working as expected then, that's the reason.



    Please post back if you get a chance to test this.


  • This is actually a bug described here:



    Unexpected result from foreach loop on 10.2




    CR140814 - fixed in TMOS v10.2.1 HF1



  • Matt - disabling CMP did not help



    Aaron - thank you for the info regarding the bug, I was unable to find it using search
  • No problem. 10.2.1HF2 has recently been released. If you upgrade to 10.2.1, I suggest installing this: