in reply to How I learned to stop worrying and love the hash slice. (boo)
in thread beyond me

So, why can't you intialize a slice under 'use strict'? In fact, even under 'no strict', you can't initialize a slice with 'my' nor 'our'. Same thing with array slices.

I ran into this restriction recently, and was just curious as to the reason.

-jehuni

  • Comment on Re: How I learned to stop worrying and love the hash slice. (boo)

Replies are listed 'Best First'.
Re: Re: How I learned to stop worrying and love the hash slice. (boo)
by dragonchild (Archbishop) on Jul 25, 2001 at 22:52 UTC
    Probably because "my @foo{qw(a b c)} = (1 .. 3)" indicates to the compiler that you're trying to create a list, but it then sees the {} and gets confuzzled.

    Update: If you don't use strict and you don't use my or our, the compiler is fine. :)