Dano Perl Utilities: Modern Alternatives

Dano utilities provided reusable Perl subroutines. Today, modern languages have standard libraries and package managers.

Utility Libraries

Modern Perl Solutions

CPAN (Comprehensive Perl Archive Network)

Central repository for Perl modules. Over 200,000 modules for every conceivable task. Production-tested, documented, and maintained.

Free 200K+ modules Standard
Mojolicious

Modern Perl web framework. Real-time web apps, built-in templates, JSON/XML handling, WebSockets. All the utilities you need.

Free Artistic License Full-stack
Dancer2

Lightweight Perl web application framework. Simple, flexible, PSGI/Plack compatible. Great for REST APIs and web services.

Free Artistic License Lightweight

Modern Language Equivalents

PHP

Most common replacement for Perl CGI. Built-in functions for forms, files, cookies, sessions. Huge ecosystem via Composer.

Free Web-focused Wide hosting
Python

Clean syntax, extensive standard library. Flask, Django for web. Great for scripting, automation, and web development.

Free PSF License Multi-purpose
Node.js

JavaScript runtime for server-side. npm has 2M+ packages. Express, Fastify for web. Same language front and back.

Free MIT License npm ecosystem

Function Equivalents

Dano Function Modern PHP Node.js
parse_form$_POST, $_GETreq.body, req.query
lock/unlockflock()proper-lockfile
write_filefile_put_contents()fs.writeFile()
html_headerheader() + HTMLres.send()
set_cookiesetcookie()res.cookie()
get_cookie$_COOKIEreq.cookies
url_encodeurlencode()encodeURIComponent()
html_encodehtmlspecialchars()he.encode()

Modern Equivalent

PHP - Form Processing (replaces Dano)
<?php
// Form data (parse_form equivalent)
$name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING);
$email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL);

// Write to file with locking (lock/write/unlock)
$fp = fopen('data.txt', 'a');
if (flock($fp, LOCK_EX)) {
    fwrite($fp, "$name,$email\n");
    flock($fp, LOCK_UN);
}
fclose($fp);

// Set cookie
setcookie('last_visit', date('Y-m-d'), time() + 86400*30);

// Output
echo "<h1>Thank you, " . htmlspecialchars($name) . "</h1>";

Recommendation

Web apps: PHP, Python, or Node.js

Keep Perl: CPAN modules + Mojolicious

Scripting: Python or modern Perl

Package Managers

  • Perl: cpanm, carton
  • PHP: Composer
  • Python: pip, poetry
  • Node.js: npm, yarn
All Examples Dano Overview