my $nmb; $sys{CountCPUs} = 0; while () { if (/^processor\s+:\s+(\d+)/) { $nmb = $1; $sys{CountCPUs}++; } elsif (/^model name\s+:\s+(.*)/) { $sys{CPUs}{"CPU$nmb"}{ModelName} = $1; } elsif (/^cache size\s+:\s+(.*)/) { $sys{CPUs}{"CPU$nmb"}{CacheSize} = $1; } elsif (/^cpu MHz\s+:\s+(.*)/) { $sys{CPUs}{"CPU$nmb"}{CPU_Power} = "$1 MHz"; } } # Die Hashstruktur schaut dann so aus: 'SysInfo' => { 'CPUs' => { 'CPU1' => { 'CPU_Power' => '2992.682 MHz', 'ModelName' => 'Intel(R) Pentium(R) 4 CPU 3.00GHz', 'CPU_Cache' => '2048 KB' }, 'CPU0' => { 'CPU_Power' => '2992.682 MHz', 'ModelName' => 'Intel(R) Pentium(R) 4 CPU 3.00GHz', 'CPU_Cache' => '2048 KB' } },