Wirewalk Instituteof AI
dev-202 Intermediate Waitlist

Perl and AI: Modernizing Scripts and Text Pipelines with LLM APIs

For engineers who own production Perl and need to call LLM APIs from it safely, add AI steps to text pipelines, and use AI assistants to modernize legacy code without breaking it.

The curriculum is being prepared and reviewed. Enrollment is not open yet.

About this course

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.

What you will be able to do

  • Choose an HTTP and JSON stack in Perl and call OpenAI, Anthropic, Gemini and a local Ollama model with correct authentication, timeouts and retry with backoff
  • Stream model output in Perl using Mojo::UserAgent or IO::Async with Future::AsyncAwait, and run bounded concurrent requests without exceeding rate limits
  • Request and validate structured JSON output against a schema, rejecting or repairing malformed responses before they enter a pipeline
  • Add an LLM classification or extraction step to an existing line-oriented text pipeline with batching, caching and per-run cost limits
  • Write offline tests for LLM-calling Perl code with Test2::V0 and recorded or mocked HTTP responses
  • Use an AI assistant to produce characterization tests for undocumented legacy Perl before refactoring it
  • Plan and execute an incremental modernization (strict, warnings, signatures, Moo or Object::Pad, Perl::Critic) and justify a keep, modernize or port decision

Syllabus

5 modules · 18 lessons · about 12 hours

Module 1: Talking to LLM APIs from Perl

The HTTP, JSON and client-module options on CPAN, and a robust first call to each major provider.
4 lessons
  1. HTTP::Tiny, LWP::UserAgent, Mojo::UserAgent and Furl: choosing a transport for API calls
  2. Calling OpenAI, Anthropic and Gemini REST APIs directly with JSON::MaybeXS and Cpanel::JSON::XS
  3. CPAN client modules compared: OpenAPI::Client::OpenAI, Langertha and WebService::Ollama
  4. Keys, timeouts, retries with backoff and logging with Log::Any

Module 2: Streaming, Concurrency and Local Models

Non-blocking Perl for streamed tokens and parallel requests, plus running models locally.
3 lessons
  1. Parsing server-sent events: streaming completions with Mojo::UserAgent
  2. Bounded concurrency with Mojo::Promise, IO::Async and Future::AsyncAwait
  3. Local inference from Perl: Ollama and OpenAI-compatible servers on your own hardware

Module 3: Structured Output in Text Pipelines

Turning free text into validated records inside the pipelines Perl is already good at.
4 lessons
  1. JSON schema prompts and validation with Type::Tiny
  2. Adding an LLM step to a line-oriented pipeline: batching, caching and idempotency
  3. Hybrid extraction: regexes first, the model for the hard residue
  4. Cost and token budgets for cron jobs and batch runs

Module 4: Testing and Shipping AI-enabled Perl

Deterministic tests, dependency pinning and deployment for Perl that calls models.
3 lessons
  1. Offline tests with Test2::V0, Test::Mojo and mocked HTTP responses
  2. Evaluating model output quality with golden files and tolerance checks
  3. Pinning dependencies with cpanfile, App::cpm and Carton, and packaging in containers

Module 5: Modernizing Legacy Perl with AI Assistants

Using Copilot, Claude and similar assistants to understand, test and refactor old Perl safely.
4 lessons
  1. Explaining unfamiliar code: prompting assistants with context, and checking what they claim
  2. Characterization tests first: locking in current behavior before any change
  3. Incremental refactoring: strict, warnings, signatures, Moo or Object::Pad, Perl::Critic and Perl::Tidy
  4. Keep, modernize or port: a decision framework and AI-assisted translation risks

Exam and certificate

The exam unlocks once you have completed every lesson. It draws 20 questions from a larger bank, spread across the modules, with the answer options shuffled for each attempt. You have 40 minutes and need 80% to pass. After a failed attempt you can try again after 24 hours, up to 3 attempts in total. Feedback is given per module, never as the answer key.

Passing earns a certificate of completion and assessment from the Wirewalk Institute of AI with a unique ID that anyone can check at institute.wirewalk.com/verify. It is not an accredited qualification or a vendor certification. How certification works.

The Wirewalk Institute of AI is independent. This course teaches publicly documented products and is not affiliated with or endorsed by OpenAI, Anthropic, Google (Gemini), Ollama, GitHub Copilot, or CPAN (Mojolicious, Langertha, OpenAPI::Client::OpenAI). Product and company names are trademarks of their respective owners.

More in AI in Software Development

All 19 courses in this track
dev-001 Free intro Available

Your First AI API Call: A One-Hour Hands-On Start

A free, one-hour, hands-on start built on one realistic job: sorting a property manager's 1,150 monthly maintenance requests. You get an API key the safe way, make real calls with curl and an official Python SDK, run them over forty work orders, read stop reasons, usage and errors, estimate the monthly cost, and decide whether the script is ready. Exercises run on your own provider account for well under a dollar.

1 h · 7 lessons Free intro
dev-201 Intermediate Available

Python AI Integration: SDKs, Async, Pydantic, Packaging and Testing

A code-first course on integrating LLMs into Python the way production code needs it: uv projects and secrets, the OpenAI, Anthropic and Google GenAI SDKs side by side, async concurrency and streaming, Pydantic structured outputs and tools, retries, local models, embeddings and RAG, FastAPI and pandas integration, testing and evals with pytest, observability, cost tracking and deployment.

15 h · 19 lessons See price at checkout
dev-203 Intermediate Waitlist

TypeScript and Node.js AI Integration

Build production AI features in TypeScript: the official OpenAI, Anthropic and Google Gen AI SDKs, the Vercel AI SDK for provider-neutral streaming and tools, Zod-typed structured outputs, in-process models with Transformers.js and node-llama-cpp, and tests that never hit a live API.

14 h · 19 lessons Join the waitlist