Make sure the IRS won't show up within each block, so make it more specific accordingly...use strict; use warnings; use Data::Dumper; my %hash = (); { local $/ = "interface "; while(<DATA>) { my ($key) = /description\s+(.*)/; next if $key =~ /^\s*$/; my ($value) = /switchport trunk allowed vlan\s*(.*)/; $hash{$key} = $value; } print Dumper \%hash; __DATA__ .....
In reply to Re: match multi-lines from config file
by xicheng
in thread match multi-lines from config file
by nidhi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |