Majian wrote:
Hi ,all:
Hello,
When I test the increment operator in Perl and find a question :
The question is :
#!/usr/bin/perl
use warnings;
my $i = 1;
print ++$i + ++$i, "\n";
The above code prints out the answer 6 .
But in the other language the anser is 5 ,
And the lesson t
On Tue, Nov 03, 2009 at 07:15:43PM +0800, Majian wrote:
> Hi ,all:
Hello,
> When I test the increment operator in Perl and find a question :
>
> The question is :
> #!/usr/bin/perl
> use warnings;
>
> my $i = 1;
> print ++$i + ++$i, "\n";
>
> The above code prints out the answer 6 .
>
2009/11/3 Majian :
> Hi ,all:
>
> When I test the increment operator in Perl and find a question :
>
> The question is :
> #!/usr/bin/perl
> use warnings;
>
> my $i = 1;
> print ++$i + ++$i, "\n";
>
> The above code prints out the answer 6 .
> But in the other language the anser is 5 ,
>
>
2009/11/3 Majian :
>
> my $i = 1;
> print ++$i + ++$i, "\n";
>
> The above code prints out the answer 6 .
> But in the other language the anser is 5 ,
>
>From the documentation
(http://perldoc.perl.org/perlop.html#Auto-increment-and-Auto-decrement):
"Note that just as in C, Perl doesn't defi
On Saturday 08 April 2006 20:19, Chris Charley wrote:
> - Original Message -
> From: "Alan_C" <[EMAIL PROTECTED]>
[ . . ]
> > Hi,
> >
> > [EMAIL PROTECTED]:~$ this_pl_script word array print
> >
> > $size prints at 3 and it finds each of the 3 words entered on the command
> > line.
> >
> >
- Original Message -
From: "Alan_C" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To:
Sent: Saturday, April 08, 2006 8:47 PM
Subject: increment operator
Hi,
[EMAIL PROTECTED]:~$ this_pl_script word array print
$size prints at 3 and it finds each of the 3 words entered on the comm
- Original Message -
From: "Alan_C" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To:
Sent: Saturday, April 08, 2006 8:47 PM
Subject: increment operator
Hi,
[EMAIL PROTECTED]:~$ this_pl_script word array print
$size prints at 3 and it finds each of the 3 words entered on the comm