Multiple Return Values

 

Unlike C/C++, the SPL return function supports multiple return values. For example,

 

multi(x)

{

    return(x, x*x); 

}

 

(a, b) = multi(10);

 

a == 10

b == 100

 

The ()s are required for multi-value assignments.