1. 14

  2. 5

    does Perl 6 have a REPL? that is one of the reasons I dont use Perl 5


    1. 9
      1. 3

        It has. Doesn’t have tab completion or syntax highlighting or anything like that, but has lineediting with linenoise/readline, generally seems to work fine.

        1. 3

          I haven’t used Perl in a long time, but there are Perl 5 REPLs in CPAN. Not as convenient as having one built-in, but shouldn’t be a show stopper.

        2. 4

          I’m not a fan of that “TIMTOWTDI” (There Is More Than One Way To Do It) mantra Damian waxes lyrical about here. It was my least favourite aspect of Perl 5.8, 10+ years ago. Back then TIMTOWTDI permeated much of the community and in my experience ensured that module documentation was often impenetrable. Typically modules would document 2+ ways of calling primitives at the micro level, refusing to recommend one over the other. Simultaneosly they would neglect to document how to use them at the macro level.

          1. 4

            That’s not my experience as a Perl user. Of course module quality varies a lot, but many are clearly written and have great examples.

            Example: DateTime or Math::Prime::Util.

            For a while there was an emphasis on object-orientated vs procedural interfaces which could be complicated.

            Maybe more than any other language Perl can make people use stuff to seem “clever”. Personally, like Conway, I’m happy to be able to use either a traditional loop or a map depending on need or style. The flexibility can lead to bad code, but that’s not really the languages fault.

            1. 1

              Well, it was my experience 10+ years ago. I haven’t really used Perl since then. The object-orientated vs proceducal interfaces was exactly it, but often they would have sub-species ISTR. It didn’t affect every module, but it was common enough that I remember it as an issue even after all this time. The two modules you link to looks fine now.

              1. 2

                I can’t say you’re wrong. Different module authors have different styles and different approaches to documentation. For good or ill, it’s quite easy to contribute to CPAN.

                On the other hand, there’s a module for almost everything, including this delightful little gem:


                From the source:

                # A module must return a true value. Traditionally, a module returns 1.
                # But this module is a revolutionary one, so it discards all old traditions.
                "Liberté, égalité, fraternité ou la mort !";
          2. 3

            Perl 6 lets you write code in precisely the way that suits you best, at whatever happens to be your (team’s) current level of coding sophistication, and in whichever style you will later find most readable …and therefore easiest to maintain.

            That very aspect is more likely to make your codebase very difficult to maintain unless you are able to maintain a high level of discipline.

            That being said, I have a soft spot in my heart for Perl6 and tools that let you express code in the way that’s most natural for the problem at hand. When it comes to “use the best tool for the job”, Perl6 can very often be that tool.

            1. 2

              So, basically, he likes TMTOWDI, which really applies to practically any version of Perl. Perl 6 certainly has some interesting idiomatic features but I could find some arbitrary problem to write a clever one-liner in Perl 5, too.