in reply to Another Challenge: Splitting data into chunks part2
The hash interface_to_desc will then have the port-channel number as keys, and the text after description To as values.my %interface_to_desc= ($Info=~/interface\s+port-channel\s+(\d+).*?switchport\s+description\s ++To\s+(\S+)\s+/gs);
Hope that helps. Oh, and have a look in the perlop manpage for how the g and s switch to regular expression works. Thats the whole secret here:-)
gc
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Another Challenge: Splitting data into chunks part2
by kwaping (Priest) on Sep 21, 2005 at 15:23 UTC |