$temp =~ /(\w+) = ([\d.]+)\[C\]/ or die "Invalid temperature format in '$temp'"; my( $temperatureType, $temperatureValue ) = ($1,$2);