Changeset 4466
- Timestamp:
- 06/25/07 18:28:30 (6 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/detect/sensors-detect (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/detect/sensors-detect
r4433 r4466 2245 2245 open(local *INPUTFILE, "/proc/cpuinfo") or die "Can't access /proc/cpuinfo!"; 2246 2246 local $_; 2247 my %entry; 2247 my $entry; 2248 2248 2249 while (<INPUTFILE>) { 2249 2250 if (m/^processor\s*:\s*(\d+)/) { 2250 push @cpu, \%entry if scalar keys(%entry); # Previous entry2251 %entry = (); # New entry2251 push @cpu, $entry if scalar keys(%{$entry}); # Previous entry 2252 $entry = {}; # New entry 2252 2253 next; 2253 2254 } … … 2257 2258 $v =~ s/\s+/ /g; # Merge multiple spaces 2258 2259 $v =~ s/ $//; # Trim trailing space 2259 $entry {$k} = $v;2260 $entry->{$k} = $v; 2260 2261 next; 2261 2262 } 2262 2263 } 2263 push @cpu, \%entry if scalar keys(%entry); # Last entry2264 push @cpu, $entry if scalar keys(%{$entry}); # Last entry 2264 2265 close INPUTFILE; 2265 2266 }
