in reply to Re: Re: quoting style for lists
in thread quoting style for lists

Isn't a string on the left side of a fat arrow a hash key? Or is there a subtle difference that I'm missing...

There is a subtle difference. The fat arrow is idiomatically used when declaring hashes, but it's not necessary, nor is that its only purpose.

my %hash = ('foo', 1, 'bar', 2); my @args = ( foo => bar => baz ); use Data::Dumper; print Data::Dumper->Dump([ \%hash, \@args ], [ hash => 'args' ]);

Replies are listed 'Best First'.
Re: Re: Re: Re: quoting style for lists
by mirod (Canon) on Aug 01, 2002 at 17:59 UTC

    I love the fat arrow for things like this:

    $element->paste( before => $some_other_element); $element->set_att( id => "JB007");

    But I really _HATE_ it when it silently turns constants into strings:

    use constant (CONSTANT => 'foo'); my %hash=( PCDATA => 'the key is the string "PCDATA", not "foo"');

    --
    The Error Message is GOD - MJD