[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Q&A on Perl script



This is probably more of a generic Perl question but I'm
only subscribed to the MacPerl list.  So....

I have numerous routines which return values.  Probably
everyone here does.  What I'd like to know is if these two
loops would do the same thing or if they would do differnt
things.  Thanks.  :-)

for( $i=0; $i<=$#theArray; $i++ ){
	$theArray[$i] = &myFunction( $theArray[$i] );
	}


	and

foreach( @theArray ){
	&myFunction( $_ );
	}

And yes, I'm trying it out, but I'm not on a Mac right now
so I will be able to post for Unix, but not the Mac until I
get home tonight.  :-/  So I guess this is _kind-of_ a
MacPerl question.  :-)

Later - and thanks in advance!  :-)


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch