How to show cpu information using perl

Asked By 20 points N/A Posted on -
qa-featured

Hi friends,

I am trying to come up with a Perl script to display information about my computer and specifically the CPU and RAM details in a clear detailed way, I understand that only a few CPUs are compatible with this I don't know if mine is compatible, if anyone is aware of how to do it the please I could use some help doing it, thank you.

SHARE
Best Answer by Bell Stanek
Best Answer
Best Answer
Answered By 0 points N/A #142049

How to show cpu information using perl

qa-featured

This Perl script determine information about the installed OS, computer name, processor, RAM, Hard Drives, and computer network settings.

Perl WinInfo.pl > output.txt

This will save the output of the script to a file called Perl script.txt. 


 

Answered By 0 points N/A #198241

How to show cpu information using perl

qa-featured

The name of the operating system is contained within the "$^O" variable.

print "$^On"

will print "linux" on Linux, "MSWin32" on Windows and "darwin" on Mac OS X.

You can also use the "Config" module:

use Config;

print "$Config{osname}n";

print "$Config{archname}n";

Note that this will display information about the system Perl was built on, rather than the one it is currently running on.

Related Questions