Passing arrays to functions in Perl
I think I have misunderstood some aspects of argument passing to functions in Perl. What's the difference between func(\@array) and func(@array) ? AFAIK, in both functions, arguments are passed by reference and in both functions we can change the elements of @array in the main program. So what's the difference? When should we use which? @array = (1,2,3); func(@array); func(\@array); sub func { ... } Also, how do I imitate pass-by-value in Perl? Is using @_ the only way? ysth AFAIK, in both functions, arguments are passed by reference and in both functions we can change the elements of @array