From 2542c6b1c38b6d08c9434aef2886914cfdac1b6c Mon Sep 17 00:00:00 2001 From: Ed Braaten Date: Thu, 23 Apr 2015 22:43:10 -0700 Subject: [PATCH] Added CPU socket count to hello perl example. Also tweaked command line argmument handling section to match output of python example script. --- perl/hello.pl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/perl/hello.pl b/perl/hello.pl index a45cf03..d05e47c 100755 --- a/perl/hello.pl +++ b/perl/hello.pl @@ -14,10 +14,15 @@ my $verinfo = `git describe --abbrev=7 --dirty --always --tags`; print "Hello Perl World! Version: $verinfo\n"; # Show list of command line arguments -print "Command line args: @ARGV\n"; -print "ARGV[0] = $ARGV[0]"; -print "ARGV[1] = $ARGV[1]"; -print "ARGV[2] = $ARGV[2]"; +print "Command line args: "; +foreach (@ARGV) { + print " $_"; +} +print "\n"; + +# Determine number of physical CPU sockets +my $socketcount=`cat /proc/cpuinfo | grep 'physical id' | sort | uniq | wc -l`; +print "CPU socket count: $socketcount\n"; # print out our animals array in reverse-sorted order print "\nValue of animals array:\n";