README
January 29, 2014 · View on GitHub
Blue Tiger is an assistant for Perl 5 to Perl 6 translation.
How to try it without installing: git clone git://github.com/Util/Blue_Tiger.git cd Blue_Tiger bin/p526 path/to/program.pl > program_and_warnings.p6
Initial Author: Bruce Gray Email: bruce dot gray at acm dot org IRC: "Util" on freenode/#perl6
Pre-requisite modules: PPI 1.204_03 or higher
Currently handles (with examples): Mandatory: Operator changes . -> ~ Invariant sigils hash{key} -> %hash{key} Casts @{arrayref} -> @(hash{KEY} -> %hash{'KEY'} map/grep comma @z=map {...} @a -> @z=map {...}, @a mapish EXPR @z=map !_, @a -> @z=map { !_ }, @a Optional: Warnings for user review of transforms.
Planned/TODO: Mandatory: for/loop for(;i++) -> loop (;i++) foreach arrow for my i open open my fh = open... bareword filehandle open FH, ... -> my fh> -> fh -> fh>){} -> for {foo}bar" -> "{foo}bar" "\lfoo" -> "{lc foo}" "\v" double-underscore __PACKAGE__ -> ?PACKAGE indent-i_fiers "foo_bar-30" or -> "{foo_bar}-30" syntax collisions '\qq[...]' -> '\\qq[...]' (especially qq) "@array" -> "@array[]" "a.b()" -> "a.b\()" "abc{def()}ghi" -> "abc\{def()\}ghi" or -> qq:!c "abc{def()}ghi" Unicode "\N{NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE}" -> "\c[NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE]" Unicode? Lots! Optional (and configurable!): Hashkey short form %hash{'KEY'} -> %hash<KEY> Remove parens if (foo) {} -> if foo {} func vs method @z=map {...} @a -> @z=@a.map({...}) Infinite loop while (1) {...} -> loop {...} qq un-hack "@{[ a * 2 ]}" -> "{a * 2}" print/say print "Hi!\n" -> say "Hi!"; Regex improvements qr{ a [ ]+ b }x -> re{ a b } XXXX smart spacing? Bad slurp for (<fh>){} -> for fh.slurp pick int(rand 12) -> (^12).pick pick array =>1}@a -> %h = @a X=> 1 @ handling sub f{(n)=@_} -> sub f (n) {} Divides (n %% 2 List::Util comma first {...} @a -> first {...}, @a