Question : Question about little code snippet

Hi,

I have a little perl script. Cause I'm not a professionall in perl, I have problem to understand following little code snippet:

[start]

my $section;
my $up;
my %section;
while (my $line = <>) {
  chomp $line;
 
  if ( ( $line =~ m;RegExA;i) || ( $line =~ m;RegExB;i) ) {

    $section = $1;
 
  }
  #Is the following elseif always true if  $section is not null ?
  elsif ($section) {
        
    if ($line =~ m/ RegExC /i) {

      if ($1 =~ /RegExD/i) {
       #What does the following line means?
      $section{$section}->{$up}++;
                        
      }
      else {
             #What does the following line means?
           $section{$section}->{$1}++;
                        
      }
    }
   
    elsif ($line=~ m/RegExD /i){
   
            $up = $1;
    }

[stop]

Thanks a lot for every help.

Answer : Question about little code snippet

 #Is the following elseif always true if  $section is not null ?
  elsif ($section) {
not null and not eq '0'

       #What does the following line means?
      $section{$section}->{$up}++;
Increment the value indexed by $up in the hashref in the value indexed by $section in the %section hash

             #What does the following line means?
           $section{$section}->{$1}++;
Increment the value indexed by $1 in the hashref in the value indexed by $section in the %section hash
Random Solutions  
 
programming4us programming4us