PERLFREEBSD(1perl)

πŸ“¦
version 5.44.0 Β· 2 versions
, in arch rolling

πŸ’– 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 sysctl with KERN_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