A great deal of production text processing still runs on Perl: log parsers, ETL jobs, report generators, bioinformatics pipelines and glue scripts nobody wants to touch. Most LLM tutorials assume Python, but Perl talks HTTP and JSON perfectly well, and the CPAN ecosystem now has working options for every major provider.
This course shows how to integrate LLMs into real Perl code. You will compare the HTTP layers (HTTP::Tiny, LWP::UserAgent, Mojo::UserAgent, Furl), call providers directly over their REST APIs or through CPAN clients such as OpenAPI::Client::OpenAI, Langertha and WebService::Ollama, stream responses with Mojo::UserAgent and Mojo::Promise or IO::Async and Future::AsyncAwait, and enforce structured JSON output with Cpanel::JSON::XS and Type::Tiny. You will then add LLM steps to line-oriented pipelines with batching, caching and cost control, and test everything offline with Test2::V0 and mocked HTTP. The second half is about modernization: using AI assistants (GitHub Copilot, Claude, ChatGPT and similar) to explain unfamiliar code, write characterization tests before any change, and refactor incrementally toward strict/warnings, signatures, Moo or Object::Pad, Perl::Critic and Perl::Tidy, with an honest decision framework for when to port instead. Module versions and Perl releases are stated as of October 2026; the stable Perl at that date is 5.44.