#!/usr/local/bin/perl -w use FileHandle; $memcmd=`/usr/sbin/prtconf | grep Memory`; $tmem = 0; $tmem_idle = new FileHandle ("$memcmd") || die "Could not open pipe for prtconf: $!\n"; while (<$tmem_idle>) { if ( $_ =~ m/^.*\s+(\d+)\s+\d+$/ ) { $tmem = $1; } } close $tmem_idle; $tmem_busy = $tmem; # Just print the info! print "The total Memory amount is: $tmem_busy"; exit 0;