Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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/)
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
You can’t perform that action at this time.