Hi

Im not sure its "normal arrays" in your when-s.
its seems the parenthesis are part of when syntax,
and the given statement is equivalent to:

given ($foo) {
    say 'small' when 1..10;
    say 'medium' when 11..20;
    say 'large' when 21..30;
    default { say 'unknown' }
}

However, perl -w warn the same for both versions.

Shimon.

On Mon, Mar 26, 2012 at 12:28 AM, ynon perek <[email protected]> wrote:

> Hi All,
>
> Started using given/when and accidentally coded this bug:
> https://gist.github.com/2200399
>
> I now know that I need to use an arrayref inside then when-s, but my
> question - what did perl think I meant with normal arrays ? will the code
> ever do anything other than default ? how ?
>
> Thanks,
>   Ynon
>
>
> _______________________________________________
> Perl mailing list
> [email protected]
> http://mail.perl.org.il/mailman/listinfo/perl
>
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to