- or download this
while (<IN>){
#remove spaces from the beginning or the end of the file
...
}
}
close IN;
- or download this
foreach my $line(keys %hash)
{
print $line
}
- 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;
}
- or download this
if ($fields[HEADER] eq 'device') {
push @{$parsed{$name}{$fields[KEY]}}, $fields[VALUE];
next;
}
}
}