http://www.perlmonks.org?node_id=1020476

tobias_hofer has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks

I need help on an perl warning. I am looking at the code for hours but I can't figure out the problem

Perl is complaining about the useless use of a private variable in void context on line 157 (#2) (W void)

Here the code:
Its a sub for parsing the content of a map-file.
Line number 157 is marked by a comment.

Any help is welcome!!!

sub ProcessMapFile { my $self = shift; my $MapFile = $_[0]; my $PlaceToPutInformation = $_[1]; #Each config profile defines its own way how to parse the map-file +. my $iterator = $ProfileInformation->{'StartLine'}; #Process map-file for ( $iterator ; $iterator < @$MapFile ; $iterator++ ) { if ( $MapFile->[$iterator] =~ m! ^ #Begin with.. (\S+) #matiching non space character: START Memory \s+ #space characters (\S+) #matiching non space character: END Memory \s+ #space characters (\S+) #matiching non space character: Size \s+ #space characters (\S+) #matiching non space character: Symbol (g = glob +al, l = static) \s+ #space characters (\S+) #matiching non space character: Name \s+ #space characters (\S+) #matiching non space character: Memory \s+ #space characters (\S+) #matiching non space character: Output Section \s+ #space characters (\S+) #matiching non space character: Input Section \s+ #space characters (\S+) #matiching non space character: Input Object !x ) { #Process Zero sized (uninitialized) memory $PlaceToPutInformation->{'Maps'}{'HIGHTEC'}{$5} = { 'Start' => $1, 'End' => $2, 'Size' => $3, 'Symbol' => $4, 'Memory' => $6, 'OutputSection' => $7, 'InputSection' => $8, 'InputObject' => $9, }; $PlaceToPutInformation->{'Memory'}{'HIGHTEC'}{'OverallSize'} = + 0 if ( not exists $PlaceToPutInformation->{'Memory'}{'HIGHTEC'} {'OverallSize'} ); $PlaceToPutInformation->{'Memory'}{'HIGHTEC'}{'OverallSize'} = $PlaceToPutInformation->{'Memory'}{'HIGHTEC'}{'OverallSize'} + + $3; $PlaceToPutInformation->{'Memory'}{'HIGHTEC'}{'Memory'}{$6} = +0 if ( not exists $PlaceToPutInformation->{'Memory'}{'HIGHTEC'}{'Memo +ry'} {$6} ); $PlaceToPutInformation->{'Memory'}{'HIGHTEC'}{'Memory'}{$6} = $PlaceToPutInformation->{'Memory'}{'HIGHTEC'}{'Memory'}{$6} ++ $3; $PlaceToPutInformation->{'Memory'}{'HIGHTEC'}{'OutputSection'} +{$7} = 0 if ( not exists $PlaceToPutInformation->{'Memory'}{'HIGHTEC'} {'OutputSection'}{$7} ); $PlaceToPutInformation->{'Memory'}{'HIGHTEC'}{'OutputSection'} +{$7} = $PlaceToPutInformation->{'Memory'}{'HIGHTEC'}{'OutputSection +'} {$7} + $3; } else { last; } } # This is line 157 #Create Array of Names for quick check! my @a = keys( %{ $PlaceToPutInformation->{'Maps'}{'HIGHTEC'} } ); $PlaceToPutInformation->{'SymbolCollection'}{'HIGHTEC'} = \@a if ( +@a); }