in reply to quotes in hash keys

Is there any truth to the rumor about bare keys?

For Perl 5 - no.

Perl 6 will, of course, be different - but that shouldn't be an issue for people developing Perl 5.

Note that this is not a question about whether one can use bare strings as keys, but about whether one should.

I think you should personally.

Replies are listed 'Best First'.
Re^2: quotes in hash keys
by kinaseman (Acolyte) on May 21, 2006 at 14:39 UTC
    Yes, I think the comment was targeted at Perl 6, but five years ago it seemed that Perl 6 might be coming soon, and that we would want to use it.

    At this point, we have so much existing code that I'm not sure we have the resources to refactor all of it. Perl 6 is supposed to be back compatible with perl 5, but if it is successful I assume we will eventually move our major codes over. When we do this, not having to catch all the unquoted keys would be helpful. Supposedly there will be a converter. I hope someone is clever enough to write one that actually works; this is the achilles heel of TMTOWTDI perhaps.

    When will all this happen? three years? five years?

      Perl 6 is supposed to be back compatible with perl 5

      No it isn't. Perl 6 is substantially different from Perl 5. You will likely be able to run Perl 5 code under Perl 6 in some way, but new Perl 6 code is going to look very different from Perl 5 code. Worrying about Perl 6 conventions is you are writing Perl 5 is a waste of time :-)

      When will all this happen? three years? five years?

      When the people doing the work have the time available to make it happen :-)