in reply to Re: passing a value to a function
in thread passing a value to a function

$array = [ ] ;
is sufficient. This will effectively "clear" the array.

Nope, it will not clear the array!
Instead it will create a new, empty anonymous array and store a reference to that in $array.