in reply to Syntax Error using STRICT and Declaring Variable

..because that's not how you declare variables? Seriously, it's hard to know what you wanted to do, but my @chicago{   qw(tiger bob munch toy)    } = () is pretty much totally broken from the very first "{".

Were you trying to create an array? A hash? An array within a hash? I honestly don't know.



($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print

Replies are listed 'Best First'.
Re^2: Syntax Error using STRICT and Declaring Variable
by ikegami (Patriarch) on Feb 02, 2006 at 04:48 UTC
    He's trying to create a hash, and initialize it using a hash slice at the same time.
Re^2: Syntax Error using STRICT and Declaring Variable
by blazar (Canon) on Feb 02, 2006 at 11:15 UTC

    More simply...

    "...because you can't declare a hash slice. Only a hash as a whole."

    the kind of dwimmery which he was expecting, which is to condense a declaration and the assignment of a slice in a single statement does not exist - and indeed would better not exist, for as far as I can say, it's not consistent at all.

Re^2: Syntax Error using STRICT and Declaring Variable
by awohld (Hermit) on Feb 02, 2006 at 04:48 UTC
    I got it straight out of the "Perl Cookbook".
      I bet there was no my.