PERLFREEBSD(1)
hey bestie!! π welcome to PERLFREEBSD(1), brought to you by the Perl Programmers Reference Guide β¨ pull up a chair, grab a boba, we're gonna talk about running Perl version 5 on FreeBSD systems π¦
π NAME π
perlfreebsd β Perl version 5 on FreeBSD systems π
πΈ DESCRIPTION πΈ
okay so this doc is literally the tea on all the FreeBSD-specific quirks that mess with how Perl version 5 (from here on out just Perl, we're besties now, no need for the full government name) gets compiled and/or runs π
π FreeBSD core dumps from readdir_r with ithreads π
so. when perl is configured to use ithreads, it's gonna reach for the re-entrant library calls instead of the non-re-entrant ones (iconic of it honestly, safety first β¨). but there's a bug in FreeBSD's readdir_r function in versions 4.5 and earlier that can cause a SEGV when reading large directories π like not me crashing over a big directory bestie.
good news though: a patch for FreeBSD libc exists (peep <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=30631> π) and it's been integrated into FreeBSD 4.6. slay.
π $^X doesn't always contain a full path in FreeBSD π
so perl tries its best to set $^X to a full path whenever it can, by asking the operating system directly. on FreeBSD the full path of the perl interpreter gets found by using sysctl with KERN_PROC_PATHNAME if that's supported β and if it isn't, it falls back to reading the symlink /proc/curproc/file π«Ά
BUT. FreeBSD 7 and earlier has a bug where either of those approaches sometimes returns an incorrect value π (receipts: <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=35703>).
in those cases perl just falls back to the old behaviour and uses C's argv[0] value for $^X. it's giving "plan b but make it functional" π
π AUTHOR π
Nicholas Clark <nick@ccl4.org>, collating wisdom supplied by Slaven Rezic and Tim Bunce. π§
Please report any errors, updates, or suggestions to <https://github.com/Perl/perl5/issues> π (they genuinely want to hear from u, no gatekeeping here)
and that's the whole vibe check bestie π this page came to you from perl v5.42.3, dated 2026-08-03, filed under PERLFREEBSD(1) in the Perl Programmers Reference Guide β love that for us, bye bye now πβ¨ππ¦
π¦ where this page comes from
- fedora 43: perl-doc 5.42.3-524.fc43 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND Unicode-3.0 AND LicenseRef-Fedora-UltraPermissive
- fedora 44: perl-doc 5.42.3-525.fc44 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND Unicode-3.0 AND LicenseRef-Fedora-UltraPermissive
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms