Steve Bertrand wrote:
> Roman Makurin wrote:
> > On Wed, Jun 24, 2009 at 03:25:57PM +0200, Jenda Krynicky wrote:
> >> From: Roman Makurin
> >>> here is complite perl script which produces such results without
> >>> any warning:
> >>>
> >>> #!/usr/bin/perl
> >>>
> >>> use strict;
> >>> use warning
Roman Makurin wrote:
> On Wed, Jun 24, 2009 at 03:25:57PM +0200, Jenda Krynicky wrote:
>> From: Roman Makurin
>>> here is complite perl script which produces such results without
>>> any warning:
>>>
>>> #!/usr/bin/perl
>>>
>>> use strict;
>>> use warnings;
>>>
>>> use constant {
>>> A => 0,
>
Jenda Krynicky wrote:
But of course this does not print anything. The shift(@a) returns the
first element of @a which is zero, assigns that to $i and then checks
whether it's true. And of course it's not. So it skips the body and
leaves the loop. Keep in mind that the value of
my $i = sh
On Wed, Jun 24, 2009 at 03:25:57PM +0200, Jenda Krynicky wrote:
> From: Roman Makurin
> > here is complite perl script which produces such results without
> > any warning:
> >
> > #!/usr/bin/perl
> >
> > use strict;
> > use warnings;
> >
> > use constant {
> > A => 0,
> > B => 1,
> >
Steve Bertrand wrote:
Roman Makurin wrote:
On Wed, Jun 24, 2009 at 04:37:52AM +0200, Gunnar Hjalmarsson wrote:
Strange.
It looks like strictures and warnings are not enabled (@a and @b are not
declared). Try to add
use strict;
use warnings;
and see if that makes Perl give you a hi
From: Roman Makurin
> here is complite perl script which produces such results without
> any warning:
>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use constant {
> A => 0,
> B => 1,
> C => 2 };
>
> my @a = (A, B, C);
> my @b = (1, 2, 3);
>
> while(my $i = shift @a
Roman Makurin wrote:
> On Wed, Jun 24, 2009 at 04:37:52AM +0200, Gunnar Hjalmarsson wrote:
>> Strange.
>>
>> It looks like strictures and warnings are not enabled (@a and @b are not
>> declared). Try to add
>>
>> use strict;
>> use warnings;
>>
>> and see if that makes Perl give you a hin
On Wed, Jun 24, 2009 at 04:37:52AM +0200, Gunnar Hjalmarsson wrote:
> Strange.
>
> It looks like strictures and warnings are not enabled (@a and @b are not
> declared). Try to add
>
> use strict;
> use warnings;
>
> and see if that makes Perl give you a hint.
>
here is complite perl scri
Roman Makurin wrote:
On Wed, Jun 24, 2009 at 03:02:00AM +0200, Gunnar Hjalmarsson wrote:
Roman Makurin wrote:
use constant {
A => 1,
B => 2,
C => 3 };
@a = (1, 2, 3);
@b = (A, B, C);
# first loop
while(my $i = shift @a) {
print $i, $/
}
# second loop
while(my
Roman Makurin wrote:
> On Wed, Jun 24, 2009 at 03:02:00AM +0200, Gunnar Hjalmarsson wrote:
>> Roman Makurin wrote:
>>> use constant {
>>> A => 1,
>>> B => 2,
>>> C => 3 };
>>>
>>> @a = (1, 2, 3);
>>> @b = (A, B, C);
>>>
>>> # first loop
>>> while(my $i = shift @a) {
>>> print $i, $/
On Wed, Jun 24, 2009 at 03:02:00AM +0200, Gunnar Hjalmarsson wrote:
> Roman Makurin wrote:
>>
>> use constant {
>> A => 1,
>> B => 2,
>> C => 3 };
>>
>> @a = (1, 2, 3);
>> @b = (A, B, C);
>>
>> # first loop
>> while(my $i = shift @a) {
>> print $i, $/
>> }
>>
>> # second loop
>>
Roman Makurin wrote:
use constant {
A => 1,
B => 2,
C => 3 };
@a = (1, 2, 3);
@b = (A, B, C);
# first loop
while(my $i = shift @a) {
print $i, $/
}
# second loop
while(my $i = shift @b) {
print $i, $/
}
My question is why the first loop work as expecte
Hi All
today i spend a lot of time with following problem.
part of code:
use constant {
A => 1,
B => 2,
C => 3 };
@a = (1, 2, 3);
@b = (A, B, C);
# first loop
while(my $i = shift @a) {
print $i, $/
}
# second loop
while(my $i = shift @b) {
print $i, $/
13 matches
Mail list logo