Skip to content

Instantly share code, notes, and snippets.

@mirekfranc
Last active September 30, 2019 23:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mirekfranc/7ea7c7afdbc0786aae4d to your computer and use it in GitHub Desktop.
Save mirekfranc/7ea7c7afdbc0786aae4d to your computer and use it in GitHub Desktop.
get list of cpu flags for quick checking
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