System...::Linux(3pm)

✨ System::Info::Linux πŸ’…

okay bestie, so this whole page is about System::Info::Linux β€” it's the object that holds all the Linux-specific info, from the System::Info Perl fam. πŸ§πŸ’– Think of it as the Linux girlie in the group chat, she knows everything about her machine and she's not shy about it.


🌸 DESCRIPTION 🌸

🫢 $si->prepare_sysinfo

Use os-specific tools to find out more about the system. that's it, that's the whole vibe β€” she goes digging with whatever the OS gives her. πŸ”

🌈 $si->prepare_os

Use os-specific tools to find out more about the operating system. same energy, different target: this one's all about the OS itself. ✨

πŸ’œ $si->linux_generic

This one snoops through /proc/cpuinfo looking for these keys, no cap:

  • "processor" β€” count the occurrences, that's your __cpu_count πŸ”’
  • "model name" β€” this becomes part of __cpu
  • "vendor_id" β€” also part of __cpu
  • "cpu mhz" β€” yep, part of __cpu
  • "cpu cores" β€” these values get added onto __cpu_count

πŸ¦‹ $si->linux_arm

the ARM girlie. she also checks /proc/cpuinfo, but for these keys:

  • "processor" β€” count the occurrences for __cpu_count πŸ”’
  • "Processor" β€” part of __cpu
  • "BogoMIPS" β€” part of __cpu
not me noticing processor and Processor are two different keys here. case sensitivity said "I'm the main character". πŸ’€

πŸŽ€ $si->linux_ppc

PowerPC time!! also reads /proc/cpuinfo, and she wants:

  • "processor" β€” count the occurrences for __cpu_count πŸ”’
  • "cpu" β€” part of __cpu
  • "machine" β€” part of __cpu
  • "clock" β€” part of __cpu
  • "detected" β€” this one alters machine if it's present πŸ‘€

⭐ $si->linux_sparc

sparc girlie reporting for duty, once again in /proc/cpuinfo:

  • "processor" β€” count the occurrences for __cpu_count πŸ”’
  • "cpu" β€” part of __cpu
  • "Cpu0ClkTck" β€” part of __cpu

πŸ‘‘ $si->linux_s390x

big iron icon behavior πŸ† she checks /proc/cpuinfo for:

  • "processor" β€” count the occurrences for __cpu_count πŸ”’
  • "Processor" β€” part of __cpu
  • "BogoMIPS" β€” part of __cpu

πŸ“ $si->prepare_proc_cpuinfo

Reads the complete /proc/cpuinfo. all of it. the whole thing. front to back, no skimming. πŸ“–

🧚 $si->count_in_cpuinfo ($regex)

Returns the number of lines $regex matches for. πŸ”

πŸ’œ $si->count_unique_in_cpuinfo ($regex)

Returns the number of lines $regex matches for. (yes bestie, the description really does say the exact same thing as the one above β€” we report, we don't editorialize 😭)

🌸 $si->from_cpuinfo ($key)

Returns the first value of that key in /proc/cpuinfo. just the first one, she's not scrolling past that. ✨


(c) 2016-2026, Abe Timmerman & H.Merijn Brand, All rights reserved.

With contributions from Jarkko Hietaniemi, Campo Weijerman, Alan Burlison, Allen Smith, Alain Barbet, Dominic Dunlop, Rich Rauenzahn, David Cantrell. 🫢 the whole friend group showed up!!

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See:

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

fr fr, read that last bit. no warranty, so don't come for her if it breaks. πŸ™ˆ

okay that's the whole page, and just so you know exactly which one you're reading: this is perl v5.40.1, dated 2026-01-25, page System...::Linux(3pm). slay, go read your cpuinfo πŸ’…βœ¨

πŸ“¦ where this page comes from