get_part_info (\%SysInfo); sub get_part_info { my ($refSi) = @_; open (PARTITIONS, "/proc/partitions") or die ("$!"); my @relevant_lines = grep (/(^#blocks|^name)/, ); close (PARTITIONS); my $current_partitions; foreach my $info (@relevant_lines) { if ($info =~ /#blocks\s*: \s*(\d+)/) { $current_partitions = $1; elsif ($info =~ /name \s*: \s* (\S+)/){ $$refSi {'Partitions Infos'} {$current_partitions} = $1; }}} }