in reply to passing anonymous empty array reference to subroutine
Here you are not passing anything. So obviously in function foo() @_ will be empty, it does not mean you are passing anonymous empty array.
If you think you are passing anonymous empty array, it should be a first element in @_array, print as $_[0] you will get 'undef', as suggested by choroba use square bracket [] to pass empty anonymous array, then print $_[0] in foo() you will get a refernce to a anonymouse array as []
|
|---|