On Aug 10, Rizwan Majeed said: >It is known that passing a list by value to a function does not make >visible to the calling function changes made to the list. > >But I dont understand how does the push() function works. Push takes >the value of a list and still makes visible to the calling block of code >the changes to the list. The push() function is internal. It has a special bit of magic that allows you to pass an array, and Perl will internally really have your array, not just some copy of its elements. You can the same effect with prototypes. Please read the 'perlsub' documentation about them. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Fw: changes visible when passing a list by value
Jeff 'japhy/Marillion' Pinyan Fri, 10 Aug 2001 06:15:46 -0700
- Fw: changes visible when passing a list by v... Rizwan Majeed
- Re: Fw: changes visible when passing a ... Michael Fowler
- Jeff 'japhy/Marillion' Pinyan