Forum Discussion

BaltoStar_12467's avatar
Jul 11, 2014

BIG-IP : variable value in case set fails

f5 BIG-IP LTM VE v11.4.0 on ESXi

tcl does not have a concept of null nil undefined

So what value do variables assume in the case where the set operation fails to retrieve a value ?

set param1 [URI::query [HTTP::uri] param1 ]

What is param1 value for case where "param1=xxx" not present in query-string ?

set cookie1 [HTTP::cookie value "cookie1"]

What's cookie1 value for case where request doesn't contain cookie "cookie1" ?

1 Reply

  • I would always general start with existent check before checking for an empty value:

    if { ( [info exists param] ) and not ( $param eq "" ) }