in reply to parsing output of uptime

This will work. There may be a better/faster way.
my $uptime = `uptime`; if ($uptime =~ /^\s+\S+\s+up\s+(\S+\s+\S+,\s+\S+),/) { print $1; } else { print "uptime gave me a weird format!"; }
Another way of doing it would be to split the output on \s+, then collect the parts that you want.