[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.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"

<FIXME> How to get nth instance of an attribute? What gets returned if there is no such attribute in the list? </>



This document was generated by Sergey Poznyakoff on November, 20 2004 using texi2html