Re: copying an array

2001-05-22 Thread Paul Johnson
On Tue, May 22, 2001 at 05:26:19PM -0400, Jeff Pinyan wrote: > On May 21, Paul Cotter said: > > > >&dummysub( ) > >&realsub('paulus') > >. > >. > >sub realsub($) > >{} > >sub dummysub( ) > >{...} It's probably also worth mentioning that calling subroutines in this manner, ie with the leading

Re: copying an array

2001-05-22 Thread Jeff Pinyan
On May 21, Paul Cotter said: >> The problem is: PROTOTYPES MUST BE SEEN BEFORE THE FUNCTION IS CALLED. > >I've seen this statement before and do not really understand it, having come >from a 'true-compiler' background. It is the 'seen' that puzzles me. > >If I have a 'require' then I believe the

Re: copying an array

2001-05-22 Thread Paul Cotter
- Original Message - From: "Jeff Pinyan" <[EMAIL PROTECTED]> To: "Aaron Craig" <[EMAIL PROTECTED]> OTOT (off the original topic) > Before I answer your question, I have to ask you to not use subroutine > prototypes. 9 out of 10 Perl programmers use them incorrectly or don't > know wh

Re: copying an array

2001-05-21 Thread Aaron Craig
At 12:49 20.05.2001 -0400, you wrote: >Before I answer your question, I have to ask you to not use subroutine >prototypes. 9 out of 10 Perl programmers use them incorrectly or don't >know what they do. > >That being said, there are TWO really useful uses: > > sub my_map (&@) { > my $code =

Re: copying an array

2001-05-20 Thread Jeff Pinyan
On May 19, Aaron Craig said: > >sub PassAnEntireArray(@) > { > my(@array) = @_; > ...do some stuff... > } > >sub PassAnArrayRef($) > { > my($ar) = @_; > ... do some stuff... > } > >I assume passing array refs (and hash refs for that

Re: copying an array

2001-05-19 Thread Aaron Craig
As long as we're on the topic, what's the story on efficiency between using an array and an array ref. Ex: sub PassAnEntireArray(@) { my(@array) = @_; ...do some stuff... } sub PassAnArrayRef($) { my($ar) = @_; ... do some stuff...

Re: copying an array

2001-05-18 Thread Timothy Kimball
Edson Manners wrote: : I'm currently copying two 1-dimensional arrays using : for loops. Is there an easier way as this may tag my : cpu due to the huge numbers I am using. @copyOfArray = @array; is the usual way to copy arrays. Question., though: Is it absolutely necessary to copy the arrays f

Re: copying an array

2001-05-18 Thread Jeff Pinyan
On May 18, Liger-dc said: >I'm currently copying two 1-dimensional arrays using >for loops. Is there an easier way as this may tag my >cpu due to the huge numbers I am using. What's wrong with: @foo = @bar; -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ Are