######octothorp.es

#perl

  • SVN::Notify 2.10 Generalizes Behavior

    https://justatheory.com/2004/10/svnnotify-2.10

  • https://justatheory.com/2009/04/svn-notify-future
  • New JavaScript Testing Method: TestSimple

    https://justatheory.com/2005/04/test-simple-js

  • Add Regular Expression Operator to SQLite

    https://justatheory.com/2006/01/add-sqlite-regexen

  • PGXN v2: Go or Rust?

    https://justatheory.com/2024/03/pgxn-language-choices

    What programming language(s) should we use to build new and revamp existing PGXN services and tools: Rust or Go? Vote your preference!

  • The Purpose of TestSimple

    https://justatheory.com/2005/05/test-simple-js-purpose

    In response to my TestSimple 0.03 announcement, Bill N1VUX asked a number of important questions about TestSimple’s purpose. Since this is just an alpha release and I’m still making my way though the port, I haven’t created a project page or started to promote it much, yet. Once I get the harness part written and feel like it’s stable and working well, I’ll likely start to promote it as widely as possible.

  • Bricolage 1.8.3 Released

    https://justatheory.com/2004/11/bricolage-1.8.3

    The Bricolage development team is pleased to announce the release of Bricolage 1.8.3. This maintenance release addresses a number of issues in Bricolage 1.8.2. The most important changes eliminate or greatly reduce the number of deadlocks caused during bulk publishes of many documents. Other changes include new contributed scripts for importing contributors and for generating thumbnail images, Russian localization, and various fixes for database transaction, template formatting, and various user interface fixes. Here are the other highlights of this release:

  • Apache::TestMB Released!

    https://justatheory.com/2004/06/apache-testmb-released

  • Please Test Pod::Simple 3.29_3

    https://justatheory.com/2015/02/please-test-podsimple-3.29_3

  • https://justatheory.com/2004/10/svnnotify-2.41
  • Corrected PostgreSQL EAN Functions

    https://justatheory.com/2006/05/postgres-ean-validation

  • Localize Your Perl Apps with this One Weird Trick

    https://justatheory.com/2014/09/localize-your-perl-apps-with-this-one-weird-trick

  • Generating XML in Perl

    https://justatheory.com/2009/06/perl-xml-generation

    I’ve been working on a big Bricolage project recently, and one of the requirements is to parse an incoming NewsML feed, turn individual stories into Bricolage SOAP XML, and import them into Bricolage. I’m using the amazing–if hideously documented–XML::LibXML to do the parsing of the incoming NewsML, taking advantage of the power of XPath to pull out the bits I need. But then came the question: what should I use to generate the XML for Bricolage?

  • Stepped Series of Numbers in Perl

    https://justatheory.com/2006/07/perl-stepped-series

  • Use Perltidy in Emacs

    https://justatheory.com/2005/12/perltidy-in-emacs

  • How I Increment Module Version Numbers

    https://justatheory.com/2004/12/increment-perl-module-version

  • DBIx::Connector and Serializable Snapshot Isolation

    https://justatheory.com/2011/09/dbix-connector-and-ssi

  • Splitting Words in Perl

    https://justatheory.com/2005/09/perl-split-words

    I’ve created a new module, Text::WordDiff, now on its way to CPAN, to show the differences between two documents using words as tokens, rather than lines as Text::Diff does. I plan to use it in Bricolage to give people a change tracking-type view (as seen in word processors) comparing two versions of a document. Fortunately, Algorithm::Diff makes this extremely easy to do. My only real problem was figuring out how to tokenize a string into words

  • Handling Multiple Exceptions

    https://justatheory.com/2010/06/handling-multiple-perl-exceptions

  • Keep DBI's connect_cached From Horking Transactions

    https://justatheory.com/2009/09/dbi-connect-cached-hack

    I’ve been on a bit of a Perl hacking tear lately. In addition to knocking out Test::XPath last week, I’ve been experimenting with TAP::Harness sources, Template::Declare, Catalyst views, a new Module::Build subclass for building database-backed applications, and, last but not least, an IRC logging bot. Oh, and that application I’m working on for PGX with Quinn Weaver. So much is crowding my mind these days that I’m having trouble sleeping. Tonight I’m up late hacking to try to get some of this stuff out of my head.

  • PGXN Language Poll Result

    https://justatheory.com/2024/05/pgxn-language-poll-result

    Results of the Postgres community poll for building PGXN v2 in Go, Rust, or both.

  • How To Calculate Percentage Change Between Two Values

    https://justatheory.com/2006/04/percent-change

    So I’m a total math n00b, but I wanted to know how much of a change there was between some benchmarking numbers, in percentages. I thought that this was really basic, but I was wrong. So I Googled and found an article describing how to calculate the percentage change between two values. I wrote this Perl script so that I’d just have it in my toolbox:

  • Testing Catalyst Template::Declare Views

    https://justatheory.com/2009/11/testing-catalyst-td-views

  • SVN::Notify 2.0 Hitting CPAN

    https://justatheory.com/2004/10/svnnotify-2.0

  • How to Use Regex Named Captures in Perl 5

    https://justatheory.com/2006/10/perl-regex-named-captures

  • Regular Expressions are Faster than Unpacking

    https://justatheory.com/2005/03/perl-pack-vs-regex

  • Bricolage Now has PHP 5 Templating

    https://justatheory.com/2005/08/bricolage-1.9.0

  • Bricolage 1.8.6 Released

    https://justatheory.com/2005/07/bricolage-1.8.6

  • Test XML and HTML with XPath

    https://justatheory.com/2009/09/test-with-xpath

    Introducing a Rails-inspired Perl module to test the structure and content of an XML or HTML document using CSS selectors.

  • Encoding is a Headache

    https://justatheory.com/2011/02/encoding-is-a-headache

  • SVN::Notify 2.57 Supports Windows

    https://justatheory.com/2006/04/svnnotify-2.57

    So I finally got ‘round to porting SVN::Notify to Windows. Version 2.57 is making is way to CPAN right now. The solution turned out to be dead simple: I just had to use a different form of piping open() on Windows, i.e., open FH, "$cmd|" instead of open FH, "-|"; exec($cmd);. It’s silly, really, but it works. It really makes me wonder why -| and |- haven’t been emulated on Windows. Whatever.

  • PostgreSQL Development: Lessons for Perl?

    https://justatheory.com/2009/07/pg-vs-perl-dev

    Pondering Conservatism I’ve been following chromatic’s new blog since it launched, and have read with particular interest his posts on the Perl 5 development and release process. The very long time between releases of stable versions of Perl has concerned me for a while, though I hadn’t paid much attention until recently. There has been a fair amount of discussion about what it means for a release to be “stable,” from, among others, now-resigned Perl Pumpking Rafael Garcia-Suarez and Perl 5 contributor chromatic. Reading this commentary, I started to ponder what other major open-source projects might consider “stable,” and how they manage stability in their development and release processes. And it occurred to me that the Perl 5 code base is simultaneously treated too conservatively and – more importantly – not conservatively enough. What open-source projects treat their code highly conservatively?

  • My Adventures with Mac OS X

    https://justatheory.com/2002/11/my-osx-adventures

    I recently decided to make the leap from Yellow Dog Linux to Mac OS X on my Titanium PowerBook. Getting everything to work the way I wanted proved to be a challenge, but well worth it. This document outlines all that I learned, so that neither you nor I will have to experience such pain again. The overall goal was to get Bricolage up and running, figuring that if it worked, then just about any mod_perl based solution would run. I’m happy to say that I was ultimately successful. You can be, too.

  • TestSimple 0.03 Released

    https://justatheory.com/2005/04/test-simple-js-0.03

  • Chimera Fonts

    https://justatheory.com/2002/09/chimera-fonts

    How to fix them in version 0.05.

  • Test.Simple 0.10 Released

    https://justatheory.com/2005/06/test-simple-js-0.10

  • Accelerate Perl Github Workflows with Caching

    https://justatheory.com/2021/11/cache-perl-github-workflows

    A quick tip for speeding up Perl builds in GitHub workflows by caching dependencies.

  • Tagmemics

    https://justatheory.com/2002/07/tagmemics

    Allison Randall gives us a peak inside Larry’s head.

  • Localize Your Perl modules with Locale::TextDomain and Dist::Zilla

    https://justatheory.com/2012/10/dist-zilla-localetextdomain

  • Catalyst with DBIx::Connector and Template::Declare

    https://justatheory.com/2009/11/catalyst-tutorial-continued

    Following up on my post yesterday introducing Catalyst::View::TD, today I’d like to continue with the next step in chapter 3 of the Catalyst tutorial. The twist here is that I’m going to use PostgreSQL for the database back-end and start introducing some database best practices. I’m also going to make use of my DBIx::Connector module to interact with the database.

  • SVN::Notify 2.70: Output Filtering and Character Encoding

    https://justatheory.com/2008/02/svnnotify-2.70

  • Lessons Learned with Perl and UTF-8

    https://justatheory.com/2004/09/perl-utf8-trials

  • Test Everything with TAP Source Handlers

    https://justatheory.com/2009/11/tap-parser-sourcehandler

    I’ve just arrived in Japan with my family. We’re going to be spending several days in Tokyo, during which time I’ll be at the JPUG 10th Anniversary PostgreSQL Conference for a couple of days (giving the usual talk), but mainly I’ll be on vacation. We’ll be visiting Kyoto, too. We’re really excited about this trip; it’ll be a great experience for Anna. I’ll be back in the saddle in December, so for those of you anxiously awaiting the next installment of my Catalyst tutorial, I’m afraid you’ll have to wait a bit longer.

  • Create Catalyst Views with Template::Declare

    https://justatheory.com/2009/11/catalyst-view-td

  • Make the Pragmas Stop!

    https://justatheory.com/2009/12/make-the-perl-pragmas-stop

  • Use of DBI in Sqitch

    https://justatheory.com/2012/05/dbi-in-sqitch

    Sqitch uses the native database client applications (psql, sqlite3, mysql, etc.). So for tracking metadata about the state of deployments, I have been trying to stick to using them. I’m first targeting PostgreSQL, and as a result need to open a connection to psql, start a transaction, and be able to read and write stuff to it as migrations go along. The IPC is a huge PITA. Furthermore, getting things properly quoted is also pretty annoying — and it will be worse for SQLite and MySQL, I expect (psql’s --set support is pretty slick).

  • DBIx::Connector Updated

    https://justatheory.com/2009/10/dbix-connector-updated

  • Custom SQLite Aggregates in Perl

    https://justatheory.com/2005/10/sqlite-perl-aggregates

    About a year ago, Josh Berkus was reviewing some Bricolage SQL code, looking to optimize it for PostgreSQL. One of the things he noticed was that we were fetching a lot more rows for an object than we needed to. The reason for this is that an object might be associated with one or more groups, and to get back a list of all of the group IDs, we were getting multiple rows. For example, if I wanted to fetch a single story with the ID 10, I might get back rows like this:

  • Execute SQL Code on Connect

    https://justatheory.com/2010/04/execute-sql-on-connect

    I’ve been writing a fair bit of PL/Perl for a client, and one of the things I’ve been doing is eliminating a ton of duplicate code by creating utility functions in the %_SHARED hash. This is great, as long as the code that creates those functions gets executed at the beginning of every database connection. So I put the utility generation code into a single function, called prepare_perl_utils(). It looks something like this:

  • Testing the Tutorial App

    https://justatheory.com/2009/11/catalyst-testing

  • Database Handle and Transaction Management with DBIx::Connector

    https://justatheory.com/2009/10/dbix-connector

    As part of my ongoing effort to wrestle Catalyst into working the way that I think it should work, I’ve just uploaded DBIx::Connector to the CPAN. See, I was using Catalyst::Model::DBI, but it turned out that I wanted to use the database handle in places other than the Catalyst parts of my app. I was bitching about this to mst on #catalyst, and he said that Catalyst::Model::DBI was actually a fork of DBIx::Class’s handle caching, and quite out of date. I said, “But this already exists. It’s called connect_cached().” I believe his response was, “OH FUCK OFF!”

  • My Catalyst Tutorial: Add Authors to the View

    https://justatheory.com/2009/11/sql-view-aggregate-magic

  • Pod: Now with Sane Web Links

    https://justatheory.com/2010/01/sane-perl-pod-links

  • Serious Exception-Handling Bug Fixed in DBIx::Connector 0.42

    https://justatheory.com/2010/12/serious-dbix-connector-bug-fixed

  • Introducing pgTAP

    https://justatheory.com/2008/06/introducing-pgtap

    So I started working on a new PostgreSQL data type this week. More on that soon; in the meantime, I wanted to create a test suite for it, and wasn’t sure where to go. The only PostgreSQL tests I’ve seen are those distributed with Elein Mustain’s tests for the email data type she created in a PostgreSQL General Bits posting from a couple of years ago. I used the same approach myself for my GTIN data type, but it was rather hard to use: I had to pay very close attention to what was output in order to tell the description output from the test output. It was quite a PITA, actually.

  • Issues Parsing Markdown with HOP::Parser

    https://justatheory.com/2009/04/hop-parsing-markdown

    Since I had some ideas for features to add on to Markdown, and since I have been wanting to learn more about parsing, I picked up my copy of Higher-Order Perl with the aim of writing a proper parser for Markdown. I’ve made a decent start, with support for simple paragraphs, code spans, escapes, and a few other things. Then I took on emphasis spans and ran smack into the limits of the current implementation of HOP::Parser.

  • Sqitch on Windows (and Linux, Solaris, and OS X)

    https://justatheory.com/2013/02/sqitch-on-windows

  • TestSimple 0.02 Released

    https://justatheory.com/2005/04/test-simple-js-0.02

  • Should URI::mysql Switch to DBD::MariaDB?

    https://justatheory.com/2025/01/uri-mysql-mariadb

    Should Sqitch and URI::mysql use DBD::MariaDB instead of DBD::mysql? If so, what are the implications for Sqitch deployment and usage?

    Follow #perl on RSS or use the

    JSON API
    
    curl -X GET \
      -H "Content-type: application/json" \
      -H "Accept: application/json" \
      "https://octothorp.es/~/perl"