John W. Krahn wrote:
Jon Molin wrote:
Jan Gruber wrote:
Hi, Jon list !
On Friday 01 March 2002 11:29 am, you wrote:
Hi list!
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
Hi list!
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
my @a = (1, 2, 3 , 4 , 5);
$_ += 2 for (@a);
print @a\n;
3 4 5 6 7
my @a = (1, 2, 3 , 4 , 5);
$_ += 2 foreach (@a);
print @a\n;
3 4 5 6 7
why isn't
Hi, Jon list !
On Friday 01 March 2002 11:29 am, you wrote:
Hi list!
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
AFAIK there's not really a difference between these two.
It merely depends on your
Jan Gruber wrote:
Hi, Jon list !
On Friday 01 March 2002 11:29 am, you wrote:
Hi list!
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
AFAIK there's not really a difference between these two.
On Mar 1, Jon Molin said:
Jan Gruber wrote:
On Friday 01 March 2002 11:29 am, you wrote:
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
AFAIK there's not really a difference between these two.
goes, TIMTOWDI, and it wouldn't be perl without that ;)
OTOH I could be completely wrong :)
HTH
John
-Original Message-
From: Jon Molin [mailto:[EMAIL PROTECTED]]
Sent: 01 March 2002 15:09
To: [EMAIL PROTECTED]
Subject: Re: some questions about for, foreach
Jan Gruber wrote:
Hi, Jon
On Fri, 1 Mar 2002, Jon Molin wrote:
It merely depends on your preferences, readable/maintanable code vs
quick dirty.
if there's no difference, what's the point of having both? I can't see
how readable/maintanable would increase by adding functions with the
same name, it'd rather
On Mar 1, Jon Molin said:
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
From perlsyn, Foreach Loops:
The foreach keyword is actually a synonym for the for
keyword, so you can use foreach
PROTECTED]
Subject: RE: some questions about for, foreach
I think it lies in the history of programming. Traditionally for loops look
like this (when written in perl)
for($i=1; $i=100; $i++){
print $i\n;
}
while foreach loops look like this.
@array = qw(one two three);
foreach (@array
It is really sad when people can't get their MLA
(Multi-Letter Acronym) correct!
It should be TIMTOWTDI
There Is More Than One Way To Do It
which is the Perl Hackers motto.
Good Luck!
Dennis
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
On Fri, 1 Mar 2002, Nikola Janceski wrote:
what the heck is TIMTOWDI?
It's TMTOWTDI
There's More Than One Way To Do It 00 pronounced like tim-toady.
-- Brett
http://www.chapelperilous.net/
On Fri, 1 Mar 2002, Dennis G. Wicks wrote:
It is really sad when people can't get their MLA
(Multi-Letter Acronym) correct!
It should be TIMTOWTDI
There Is More Than One Way To Do It
I prefer
http://www.chapelperilous.net/
On Fri, 1 Mar 2002, Brett W. McCoy wrote:
On Fri, 1 Mar 2002, Dennis G. Wicks wrote:
It is really sad when people can't get their MLA
(Multi-Letter Acronym) correct!
It should be TIMTOWTDI
There Is More Than One Way To Do It
I prefer
Err, ignore that... I hit C-x instead of
On Friday, March 1, 2002, at 10:22 , John Edwards wrote:
I think it lies in the history of programming. Traditionally for loops
look
like this (when written in perl)
for($i=1; $i=100; $i++){
print $i\n;
}
from the Learning Perl book p63
One could write, as an alternative to for:
Yeah, yeah. So I made a typo. :p
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 01 March 2002 18:00
To: [EMAIL PROTECTED]
Subject: TIMTOWDI Was: RE: some questions about for, foreach
It is really sad when people can't get their MLA
(Multi-Letter Acronym
Jon Molin wrote:
Jan Gruber wrote:
Hi, Jon list !
On Friday 01 March 2002 11:29 am, you wrote:
Hi list!
I've always thought there's a difference between for and foreach, that
for uses copies and foreach not. But there's no diff is there?
AFAIK there's not really a
16 matches
Mail list logo