Next: , Previous: , Up: Variables   [Contents][Index]


12.2.4.4 Accessing Elements of A/V Pair Lists

Elements of an avlist are accessed as if it were an array, i.e.:

$variable [ attribute-name ]

If the attribute attribute-name is of string data type and variable may contain more than one pair with this attribute, adding an asterisk after attribute-name returns concatenated values of all such pairs:

$variable [ attribute-name * ]

Examples:

x = (NAS-Port-Id = 127.0.0.1 \
     Reply-Message = "a long"
     Reply-Message = " string"

$x[NAS-Port-Id] ⇒ 127.0.0.1
$x[Reply-Message] ⇒ "a long"
$x[Reply-Message*] ⇒ "a long string"