The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Perl::ToPerl6::Transformer::Variables::QuoteHashKeys - Transform bareword hash keys into quoted hash keys

AFFILIATION

This Transformer is part of the core Perl::ToPerl6 distribution.

DESCRIPTION

Anything enclosed in braces should be compilable code in Perl6, and unfortunately bareword hash keys such as %foo{a} are interpreted as %foo{a()}, so when the function a() can't be found, the block fails to compile:

  %foo{a} --> %foo{'a'}
  %foo{'a'} --> %foo{'a'}

The transformer also supports a perl6_mode option, which replaces %foo{a} with %foo<a> style "pointy blocks". The default, though, is to a more perl5ish style.

Transforms variables outside of comments, heredocs, strings and POD.

CONFIGURATION

This Transformer is not configurable except for the standard options.

AUTHOR

Jeffrey Goff <drforr@pobox.com>

COPYRIGHT

Copyright (c) 2015 Jeffrey Goff

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.