PERLFREEBSD(1perl)
π NAME π
perlfreebsd β literally the whole tea on running Perl version 5 on FreeBSD systems, bestie πβ¨
(It lives in the Perl Programmers Reference Guide, which is giving official. Periodt. π )
πΈ DESCRIPTION πΈ
Okay so this page is the lil gossip sesh about all the FreeBSD-specific stuff that changes how Perl version 5 (from here on out just "Perl", we're on nickname basis π) gets compiled and/or run. Pay attention, it's important. π
π¦ FreeBSD core dumps from readdir_r with ithreads π¦
So the thing is β when perl is configured to use ithreads, it's gonna reach for the re-entrant library calls instead of the non-re-entrant versions, because that's just the vibe when you're threaded. β¨
π¨ BUT. There is a bug in FreeBSD's readdir_r function in versions 4.5 and earlier that can cause a SEGV when reading large directories. Like, it will just die. No cap. π
Good news though: a patch for FreeBSD libc is available, and it has already been integrated into FreeBSD 4.6. The patch lives here:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=30631
She's fixed, you just gotta be on the right version. π«Ά
π $^X doesn't always contain a full path in FreeBSD π
Okay so this one's about $^X, and the way that it usually tries so hard to be a full path. π
perl sets $^X where possible to a full path by asking the operating system, like, "hey bestie, where am I?" π₯Ί On FreeBSD, the full path of the perl interpreter gets found by:
- using
sysctlwithKERN_PROC_PATHNAME, if that's supported, otherwise - reading the symlink
/proc/curproc/fileπ«
π Here's the drama: FreeBSD 7 and earlier has a bug where either approach sometimes hands back an incorrect value. Not iconic of it. The bug report is right here: text https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=35703
In these cases, perl will fall back to the old behaviour of using C's argv[0] value for $^X. So it's giving "fine, I'll do it myself" energy. π
π AUTHOR π
This was written by Nicholas Clark <nick@ccl4.org>, who was collating wisdom supplied by Slaven Rezic and Tim Bunce. Collaboration slay. π
Please report any errors, updates, or suggestions here, bestie:
https://github.com/Perl/perl5/issues
That's the whole page, you ate it fr fr πβ¨
Also this is from perl v5.44.0, dated 2026-10-17 β literally stamped on the page PERLFREEBSD(1perl). Byeee ππ
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms