in reply to passing anonymous empty array reference to subroutine

Hi, Here is how I can pass an anonymous empty array to a subroutine: &foo(qw());

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 []


All is well. I learn by answering your questions...