Perl Benchmark IN sub with grep

If you miss the IN function in Perl like the function in PL/SQL, then you could use grep and an array to check this:

I made a Benchmark to check how fast his solution is:

Result:

We see the normal way is the fastest and you could use an defined array to speed up by 7%. The Code is short but much slower than an or comparison.

Get the Core temp with lm-sensors

install sensors with:

for the average core temp use this:

and max core temp:

Important is in sed to escape the ‘|’ in regex like ‘|’

CPU Temperature

if you want to get the core temperature you could use sensors, install with :

if it detects your cpu temperature you could use this script to get the them:

Result looks like this:

if you only want to get the temperature you could use this:

Result looks like this: