No. In
$i = $i++;
the increment is done before the assignment.
In other words
$i = $i++;
is equivalent to
$i = ($i++);
not
($i = $i)++;
-P
On Fri, 15 Jun 2001, cloud wrote:
>
> although $i = $i run before $i++, But
> the increment should be work, so $i should be 1, isn't it?
>
> ----- Original Message -----
> From: "Paul G. Weiss" <[EMAIL PROTECTED]>
> To: "cloud" <[EMAIL PROTECTED]>
> Cc: "'[EMAIL PROTECTED]'"
> <[EMAIL PROTECTED]>
> Sent: Friday, June 15, 2001 11:42 AM
> Subject: Re: Strange Question? Is compiler fault?
>
>
> > The expression $i++ has the *effect* of incrementing $i
> > but its *value* is the value of $i before the increment.
> >
> > So the assignment
> >
> > $i = $i++;
> >
> > is a no-op, because you are assigning to $i the value that
> > it had before the increment.
> >
> > -Paul
> >
> >
> >
> >
> > On Fri, 15 Jun 2001, cloud wrote:
> >
> > > All:
> > >
> > > I excute follow code & got some Strange result,
> > > Why? Why $i = 0
> > > ===========================
> > > $i = 0;
> > > $i = $i++;
> > > print "$i\n";
> > > ===========================
> > >
> > >
> > > _______________________________________________
> > > Perl-Win32-Users mailing list
> > > [EMAIL PROTECTED]
> > > http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
> > >
>
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
>
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users