Re: question on foreach loop

2008-05-01 Thread Rob Dixon
Andrew Curry wrote: >> -Original Message- >> rom: J. Peng [mailto:[EMAIL PROTECTED] > Sent: 01 May 2008 15:31 > To: [EMAIL PROTECTED] > Cc: beginners@perl.org > Subject: Re: question on foreach loop > > To add a statement of "print $_" fol

RE: question on foreach loop

2008-05-01 Thread Andrew Curry
>-Original Message- >rom: J. Peng [mailto:[EMAIL PROTECTED] Sent: 01 May 2008 15:31 To: [EMAIL PROTECTED] Cc: beginners@perl.org Subject: Re: question on foreach loop To add a statement of "print $_" follow the foreach, you will see what was happening. foreach (@data)

Re: question on foreach loop

2008-05-01 Thread J. Peng
To add a statement of "print $_" follow the foreach, you will see what was happening. foreach (@data){ print "$_\n"; splice @data,0,1; print "printing [EMAIL PROTECTED] = @data\n"; } On Thu, May 1, 2008 at 10:15 PM, <[EMAIL PROTECTED]> wrote: > Hi Members, > Can someone explain why the

Re: question on foreach loop

2008-05-01 Thread Chas. Owens
On Thu, May 1, 2008 at 10:27 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Thu, May 1, 2008 at 10:15 AM, <[EMAIL PROTECTED]> wrote: > > Hi Members, > > Can someone explain why the foreach loop did not iterate 10 times. > snip > > > foreach (@data){ > > splice @data,0,1; > > print

Re: question on foreach loop

2008-05-01 Thread Chas. Owens
On Thu, May 1, 2008 at 10:15 AM, <[EMAIL PROTECTED]> wrote: > Hi Members, > Can someone explain why the foreach loop did not iterate 10 times. snip > foreach (@data){ > splice @data,0,1; > print "printing [EMAIL PROTECTED] = @data\n"; > } snip Mucking about with the array being iterate