in reply to Re^15: Why? (each...)
in thread Why? (each...)

The context is actually "I still am fuzzy about the difference between “square brackets,” “braces,” and “parentheses.”".

You said parens indicate a list, so that would mean %hash should be used.

sub g { return { ... } } sub h { return { ... } } my %hash = (f ? g : h);

That's wrong wrong wrong.

Replies are listed 'Best First'.
Re^17: Why? (each...)
by Argel (Prior) on May 16, 2011 at 21:05 UTC
    I took the context to be like how it was used in the OP -- i.e. something like "When declaring and initializing hashes (%) and arrays (@), do I use {}, [], or () to assign the values?".

    Elda Taluta; Sarks Sark; Ark Arks

      One never uses {} or [] to initialise a hash or array. No need to make stuff up about ().

        The original poster made that exact mistake!!! We're at level 19 and you still haven't figured that out? I guess you just jumped in without reading the entire thread? Impressive trolling!! Well played!! I salute you!! :bow:

        Elda Taluta; Sarks Sark; Ark Arks