Last active
September 30, 2019 23:25
-
-
Save mirekfranc/7ea7c7afdbc0786aae4d to your computer and use it in GitHub Desktop.
get list of cpu flags for quick checking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v5.10; | |
sub cpuinfo | |
{ | |
my $flags; | |
open my $cpuinfo, "<", "/proc/cpuinfo" or die "failed to open /proc/cpuinfo: $!\n"; | |
while (<$cpuinfo>) | |
{ | |
if (/flags/) | |
{ | |
s/^flags\s+:\s+//; | |
for my $f (split /\s+/) | |
{ | |
$flags->{$f} = 1; | |
} | |
} | |
} | |
close $cpuinfo; | |
return $flags; | |
} | |
say for (sort keys %{&cpuinfo}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment