Help for this page

Select Code to Download


  1. or download this
    while (<IN>){
     #remove spaces from the beginning or the end of the file
    ...
      }
    }
    close IN;
    
  2. or download this
    foreach my $line(keys %hash)
    {
    print $line
    }
    
  3. or download this
    ##defining the fields you want including the file, HEADER would be the
    + first field and if name or device then KEY is the next value over an
    +d VALUE the next
    use constant {
    ...
                $name = $fields[KEY];
                next;
            }
    
  4. or download this
     if ($fields[HEADER] eq 'device') {
                push @{$parsed{$name}{$fields[KEY]}}, $fields[VALUE];
                next;
            }
        }
    }