in reply to Re^9: Referencing in Function not working correctly.
in thread Referencing in Function not working correctly.

I just put this code through.

my @x = ("1"); my @y = ("1"); my @z = ("1"); print "Before: @x, @y, @z\n"; (@x, @y, @z) = (); print "After: @x, @y, @z\n";

and got this output:

Before: 1, 1, 1 After: , ,

It initialized all variables.

Replies are listed 'Best First'.
Re^11: Referencing in Function not working correctly.
by chromatic (Archbishop) on Apr 02, 2010 at 21:50 UTC
    It initialized all variables.

    Yes, but that's completely different than what people are trying to tell you. If you write:

    my @x;

    ... @x contains the same thing as if you had written:

    my @x = ();

    ... because @x will contain no elements. People are trying to tell you not to waste time and keystrokes with the latter, because it's unnecessary and a distraction.

      Ok. Thanks for clearing things up. I was thinking they are trying to tell me something else.