...gives the result that you say that you want. Although I have a sneaky suspicion that this is not all that you want ;)my %interfaces; while (<DATA>) { if (/interface Vlan(\d+)/) { next if $1 == 1; $interfaces{"Vlan$1"} = $1; } } print Dumper(\%interfaces);
In reply to Re: create key-value pair
by McDarren
in thread create key-value pair
by nidhi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |