while(<DATA>){ if(/port-channel\s+(\d+)/ .. /]\s+\*/){ $1 and $section = $1; $section || next; if(/\s+Ports:/ .. /\n\n/){ /(\S+)\s+(\[\S+\])/ and $data->{$section}{$1} = $2 } } } use Data::Dumper; die Dumper($data) __END__ $VAR1 = { '1' => { 'fc2/5' => '[up]', 'fc1/5' => '[up]' }, '3' => { 'fc1/1' => '[up]' } };
In reply to Re: Splitting data into chunks!
by sh1tn
in thread Splitting data into chunks!
by blackadder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |