in reply to Re: Dereference inside a regex
in thread Dereference inside a regex
ya,.. its also strange to me
here the code in its current state:
The warning looks like this:
Ok, i am just guessing that this is because of the dereferencing, but the scalar
$state is initialized with '0'. So I am running out of plans...
here the code in its current state:
and I get this message from perl-diagnostics, moreover i am using eclipse and epic-plugin and strawberryperl 5.10.0.sub AnalyseMapFile { my $self = shift; my $MapFile = $self->{MAPFILEINFO}{MAPFILECONTENT}; my $PlaceToPutInformation = $self->{MEMORYMAP}; $self->{MAPFILEINFO}{ProfileInformation} = $ProfileInformation; my $memory_section = ''; my $state = 0; my $memory_size = 0; my $state_smybol = { 1 => 'Image component sizes', 2 => ' Code \(inc\. data\) RO Data RW Data ZI Dat +a Debug Object Name', }; #Each config profile defines its own way how to parse the map-file +. #Process map-file for ( my $iterator = $ProfileInformation->{'StartLine'} ; $iterator < @$MapFile ; $iterator++ ) { chomp($MapFile->[$iterator]); next if (! $MapFile->[$iterator]); if (( $state == 0 ) ###THIS IS LINE 104 && ( $MapFile->[$iterator] =~m/$MTA::Profile_ARM::state_symbo +l->{1}/)) { $state = 1; next; } elsif (( $state == 1 ) && ( $MapFile->[$iterator] =~m/$MTA::Pr +ofile_ARM::state_symbol->{2}/)) { $state = 2; next; } elsif ( $state == 2 ) { #Get module information my($Code, $CodeData, $ROData, $RWData, $ZIData, $Debug, $O +bjName) = split(/\s/,$MapFile->[$iterator]);
The warning looks like this:
Use of uninitialized value in regexp compilation at D:/_Debug/Project/profile_ARM.pm line 104 (#1) (W uninitialized) An undefined value was used as if it were alread +y defined. It was interpreted as a "" or a 0, but maybe it was a mi +stake. To suppress this warning assign a defined value to your variables. To help you figure out what was undefined, perl will try to tell y +ou the name of the variable (if any) that was undefined. In some cases it + cannot do this, so it also tells you what operation you used the undefine +d value in. Note, however, that perl optimizes your program and the opera +tion displayed in the warning may not necessarily appear literally in y +our program. For example, "that $foo" is usually optimized into "that + " . $foo, and the warning will refer to the concatenation (.) operat +or, even though there is no . in your program.
Ok, i am just guessing that this is because of the dereferencing, but the scalar
$state is initialized with '0'. So I am running out of plans...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Dereference inside a regex
by AnomalousMonk (Archbishop) on Jun 08, 2013 at 10:38 UTC |
In Section
Seekers of Perl Wisdom