Skip to content

Instantly share code, notes, and snippets.

@alexander-potemkin
Created September 14, 2012 17:59
Show Gist options
  • Save alexander-potemkin/558e71744225704e0b6b to your computer and use it in GitHub Desktop.
Save alexander-potemkin/558e71744225704e0b6b to your computer and use it in GitHub Desktop.
perl detect arch
#!/usr/bin/perl -w
use strict;
chomp(my $arch = `uname -m`);
if ($arch eq 'x86_64') {
print "64 bit here\n";
} elsif ($arch eq 'i386') {
print "32 bit here\n";
} else {
print "Sorry, I'm lost with '$arch' architecture."
}
print "$arch\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment