RE: Use of FOR statement (OT and apologies)

2004-01-09 Thread McMahon, Chris
mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 3:21 PM To: [EMAIL PROTECTED] Subject: Re: Use of FOR statement Paul Kraus wrote: > > Wow just tested that for (@array) do something. > I didn't think that would work. > > So there is no difference as far as the compiler is c

Re: Use of FOR statement

2004-01-09 Thread Bruce Ferrell
] Subject: Re: Use of FOR statement Paul Kraus wrote: Wow just tested that for (@array) do something. I didn't think that would work. So there is no difference as far as the compiler is concerned with for and foreach? Why bother having both then? The practical reason is likely to be histo

Re: Use of FOR statement

2004-01-09 Thread James Edward Gray II
On Jan 9, 2004, at 7:15 AM, Paul Kraus wrote: Use english? perldoc English TMTOWTDI? Pronounced "Tim Toady", There's More Than One Way To Do It. The Perl motto. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Use of FOR statement

2004-01-09 Thread Paul Kraus
Use english? TMTOWTDI? Paul Kraus --- PEL Supply Company Network Administrator > -Original Message- > From: Rob Dixon [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 08, 2004 5:21 PM > To: [EMAIL PROTECTED] > Subject: Re: Use of FOR statement

Re: Use of FOR statement

2004-01-08 Thread Rob Dixon
Paul Kraus wrote: > > Wow just tested that for (@array) do something. > I didn't think that would work. > > So there is no difference as far as the compiler is concerned with for and > foreach? Why bother having both then? The practical reason is likely to be historical, but Larry would tell you a

Re: Use of FOR statement

2004-01-08 Thread Randal L. Schwartz
> "Paul" == Paul Kraus <[EMAIL PROTECTED]> writes: Paul> Wow just tested that for (@array) do something. Paul> I didn't think that would work. Paul> So there is no difference as far as the compiler is concerned Paul> with for and foreach? Why bother having both then? So you can avoid typing

RE: Use of FOR statement

2004-01-08 Thread Paul Kraus
Original Message- > From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 08, 2004 1:37 PM > To: [EMAIL PROTECTED] > Subject: Re: Use of FOR statement > > >>>>> "Dan" == Dan Anderson <[EMAIL PROTECTED]> writes: > >

Re: Use of FOR statement

2004-01-08 Thread Randal L. Schwartz
> "Dan" == Dan Anderson <[EMAIL PROTECTED]> writes: Dan> On Wed, 2004-01-07 at 20:39, Paul Harwood wrote: >> I am reading through a book on Objects and References and I don't >> understand this statement: >> >> $sum += $_ for split //; Dan> FWIW, for is synonymous with foreach. Syntactical

Re: Use of FOR statement

2004-01-08 Thread Dan Anderson
On Wed, 2004-01-07 at 20:39, Paul Harwood wrote: > I am reading through a book on Objects and References and I don't > understand this statement: > > $sum += $_ for split //; FWIW, for is synonymous with foreach. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Re: Use of FOR statement

2004-01-08 Thread Rob Dixon
Paul Harwood wrote: > > I am reading through a book on Objects and References and I don't > understand this statement: > > $sum += $_ for split //; > > I thought a FOR statement needed to be in braces. How is it being used > in this context? Hi Paul. In this instance 'for' is working as a statem

Re: Use of FOR statement

2004-01-08 Thread Paul Johnson
Paul Harwood said: > I am reading through a book on Objects and References and I don't > understand this statement: > > $sum += $_ for split //; > > I thought a FOR statement needed to be in braces. How is it being used > in this context? It means exactly the same as: for (split //) {

Use of FOR statement

2004-01-08 Thread Paul Harwood
I am reading through a book on Objects and References and I don't understand this statement: $sum += $_ for split //; I thought a FOR statement needed to be in braces. How is it being used in this context? --Paul