jabirahmed has asked for the wisdom of the Perl Monks concerning the following question:
> in this case it should ideally throw some error but it just considers > a,b,c... as 0 ? why does it do that@a=qw( 1 2 3 4 a b c g f); $s=0; foreach $i(@a){ $s+= $i; } print $s; $perl a.pl 10
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how does perl handle variables
by marto (Cardinal) on May 17, 2013 at 11:41 UTC | |
|
Re: how does perl handle variables
by Corion (Patriarch) on May 17, 2013 at 11:43 UTC | |
|
Re: how does perl handle variables
by AnomalousMonk (Archbishop) on May 17, 2013 at 22:17 UTC | |
|
Re: how does perl handle variables
by Laurent_R (Canon) on May 17, 2013 at 21:03 UTC |