1. 33

  2. 10

    “ In an interview in 1999, he posed the question, “When’s the last time you used duct tape on a duct?””

    You got me there, Larry!

    1. 4

      I’ve started to learn perl in 2016 and I’m in love. Where else can you make a script that executes shell code that executes awk and process that in perl again that easy?

      I’ve also used it to implement some simple CGI web-“apps” like my teletext-to-html converter. It’s no beauty, but i bodged it together so fast and got up-and-running in no time at all.

      1. [Comment removed by author]

        1. 3
          my $foo = `ls -l | sort -R`;

          looks a lot easier to me than

          import subprocess
          tmp = subprocess.Popen(['ls', '-l'], stdout=subprocess.PIPE)
          foo = subprocess.check_output(['sort', '-R'], stdin=tmp.stdout)
          1. 5
            foo = `ls -l | sort -R`

            Shorter in Ruby.

            Though I do appreciate that you’ve gone back to CGI. Web frameworks have gotten so big, we forget how simple and easy things can be. I was going to go that route for something quick that definitely didn’t need Rails, but I found out that the built in http server was even easier than that:

            require ‘webrick’
            server = WEBrick::HTTPServer.new(Port: 8080) # takes config for TLS too!
            server.mount_proc(‘/‘) do |req, res|
              res.status = 200
              res.content_type = ‘text/plain’
              res.body = ‘Hello, web!’
            trap ‘INT’ { server.shutdown } # graceful shutdown on ctrl-C

            Typed on my phone, so it probably uses invalid quote characters, oh well.

            I run most of my personal projects this way, plain Ruby without any other web server like Apache or Nginx.

            1. 2

              Why shell out when you can call internal libraries? From C# (off the top of my head and I had a REPL open):

              var r = new Random();
              var foo = Directory.EnumerateFileSystemEntries(".").OrderBy(x => r.Next());
              1. 1

                That’s because shell languages are designed to make it easy to describe shell operations. One can do the same thing with DSL’s or functions in other high-level languages. When I left Perl etc, my solution was to have a pre-made library and script for that to automate the boilerplate with the language itself being a high-level BASIC variant. This autogenerated code for either an industrial BASIC I was using or usually C if I wanted an optimizing compile. I had a separate command/app to use on those that essentially preprocessed them this way. Pretty much just as easy to type as shell scripts, consistent with my usual language, and penalty being a brief pause for preprocessing and compile. The latter were ultra-fast since BASIC compilers were ultra-fast.

            2. 1

              Are you learning Perl 5 or 6?

            3. 3

              I haven’t used Perl for a few years now and reading this reminds how much I enjoyed it. I wonder what I have been missing and what has been added to the language and community since 2015. It’s great to hear that there is no slowing down for Perl.

              1. 3

                Happy Birthday!

                While I’ve never written a line of Perl, the per stands at FOSDEM and OSCON are always the ones I go to and chat. If you want to find people that have been doing creative programming language community work for decades, it’s there.

                1. 1

                  I received an awkward hug at the FOSDEM stand once, but yeah, good people indeed.

                  1. 1

                    I’m not sure if I should parse this as ironic… :)

                2. 1

                  I don’t enjoy working in Perl, but I will definitely give it its due. It powered my early career and introduced me to the idea that scripting could be more than just the bourne shell.

                  And yeah the community is incredible. I used to be active in the Boston Perl Mongers community and it was fantastic.

                  1. 1

                    I remember writing my first CGI scripts in Perl 4.036, learnt from the Camel Book. Things were a lot simpler then and Perl certainly made text processing almost trivial.

                    I’ve not used Perl in anger in almost 20 years and there are many criticisms that can be levelled at the language, but it would be churlish to downplay the influence it’s had. Happy birthday Perl :)