#!/usr/bin/perl

my $a = `ioreg -l | grep IOPlatformSerialNumber`;

if ( $a =~ /\=\ \"([^\"]+)\"/ ) {
  print $1;
} else {
  print "error";
}

