Re: RE: foreach question

2006-04-07 Thread
Sent: 4/7/2006 8:54:47 AM To: activeperl@listserv.ActiveState.com Subject: RE: foreach question > Conrad, Bill (ThomasTech) <> wrote: > > I thought that Perl had another internal variable that contained > the > > numerical index of each array entry without having to count them.

RE: foreach question

2006-04-07 Thread Hicks, Robert
is almost always a better choice." >-Original Message- >From: [EMAIL PROTECTED] [mailto:activeperl- >[EMAIL PROTECTED] On Behalf Of Thurn, Martin >Sent: Friday, April 07, 2006 8:42 AM >To: DZ-Jay; Conrad, Bill (ThomasTech) >Cc: activeperl@listserv.ActiveState.com >Subje

RE: foreach question

2006-04-07 Thread Brian Raven
Conrad, Bill (ThomasTech) <> wrote: > I thought that Perl had another internal variable that contained the > numerical index of each array entry without having to count them. I > guess what I thought was happening internally was that Perl was > maintaining an index of @List and returning @Lis

RE: foreach question

2006-04-07 Thread Thurn, Martin
> In fact, "foreach" is just a short hand for those times when > you only need the contents of the list or to perform an > operation "for each item", but have no need for the index or > the list itself. Not sure what you're implying here, but the fact is: there is NO DIFFERENCE between 'for

RE: foreach question

2006-04-07 Thread Conrad, Bill (ThomasTech)
> > > my @List = qw(one two three); > > for(0 .. $#List) { > print "Indice $_ contains: $List[$_]\n"; > } Thanks Dave After seeing your reply it jogged my memory and this is exactly how I did it before. I had forgotten about the $#list Thanks to all who replied to my question.

Re: foreach question

2006-04-07 Thread DZ-Jay
On Apr 6, 2006, at 15:25, Conrad, Bill (ThomasTech) wrote: I thought that Perl had another internal variable that contained the numerical index of each array entry without having to count them. I guess what I thought was happening internally was that Perl was maintaining an index of @L

Re: foreach question

2006-04-06 Thread Williamawalters
In a message dated 4/6/2006 6:17:47 P.M. Eastern Standard Time, [EMAIL PROTECTED] writes:   > > From: "Conrad, Bill (ThomasTech)"> > Subject: foreach question> > > > Give a foreach loop> > > > foreach $entry ( @list ) {> > > > }>

Re: foreach question

2006-04-06 Thread Dave Crawford
Conrad, Bill (ThomasTech) wrote: Hi All Give a foreach loop foreach $entry ( @list ) { } Is there a way to get the position index within @list $entry is from without counting the iterations of the loop my @List = qw(one two three); for(0 .. $#List) { pr

Re: foreach question

2006-04-06 Thread Petr Vileta
- Original Message - From: "Conrad, Bill (ThomasTech)" <[EMAIL PROTECTED]> To: Sent: Thursday, April 06, 2006 6:38 PM Subject: foreach question Hi All Give a foreach loop foreach $entry ( @list ) { } Is there a way to get the position index within @list $entry

RE: foreach question

2006-04-06 Thread Blakley, Brian
> From: "Conrad, Bill (ThomasTech)" > Subject: foreach question > > Give a foreach loop > > foreach $entry ( @list ) { > > } > > Is there a way to get the position index within @list $entry is from > without counting the iterations of the loop Wha

Re: foreach question

2006-04-06 Thread David Nicol
No. On 4/6/06, Conrad, Bill (ThomasTech) <[EMAIL PROTECTED]> wrote: > Hi All > > Give a foreach loop > > foreach $entry ( @list ) { > > } > > Is there a way to get the position index within @list $entry is from > without counting the iterations of the loop > > Than

RE: foreach question

2006-04-06 Thread Conrad, Bill (ThomasTech)
Hi Kyle Thanks for your reply. If I have the following my @List ( 'one' , 'two' , 'three' ) ; foreach ( @List ) { print $_ . "\n" ; } it will print one two three I thought that Perl had ano

Re: foreach question

2006-04-06 Thread
- Original Message - From: Conrad, Bill (ThomasTech) Sent: 4/6/2006 12:38:20 PM To: activeperl@listserv.ActiveState.com Subject: foreach question > Hi All > > Give a foreach loop > > foreach $entry ( @list ) { > > } > > Is ther

foreach question

2006-04-06 Thread Conrad, Bill (ThomasTech)
Hi All Give a foreach loop foreach $entry ( @list ) { } Is there a way to get the position index within @list $entry is from without counting the iterations of the loop Thanks Bill Conrad ___ ActivePerl mailing list