O'Hello There

can someone give a clue on what is the best way to split a file such as this
vsan 1060 wwn 20:00:00:e0:69:41:26:e7 fcid 0x6d0d00 area dynamic vsan 1030 wwn 10:00:00:00:c9:28:29:44 fcid 0xa70001 dynamic vsan 1030 wwn 10:00:00:00:c9:28:2c:55 fcid 0xa70002 dynamic vsan 1060 wwn 50:06:0b:00:00:0b:3a:0e fcid 0x6d0e00 area dynamic vsan 1060 wwn 20:00:00:e0:69:41:3b:ca fcid 0x6d0f00 area dynamic vsan 1060 wwn 20:00:00:e0:69:40:d1:3f fcid 0x6d1000 area dynamic vsan 1060 wwn 20:00:00:e0:69:41:55:1f fcid 0x6d1100 area dynamic vsan 1060 wwn 20:00:00:e0:69:41:57:1e fcid 0x6d1200 area dynamic vsan 1060 wwn 10:00:00:00:c9:45:3a:21 fcid 0x6d0006 dynamic vsan 1060 wwn 20:00:00:e0:69:41:55:ff fcid 0x6d1300 area dynamic vsan 1050 wwn 50:06:0b:00:00:30:0d:f4 fcid 0x140100 area dynamic logging server 10.33.34.235 6 interface port-channel 1 switchport trunk allowed vsan 1000 switchport trunk allowed vsan add 1050 switchport description To CCC219 10.33.81.56 switchport mode E interface port-channel 3 switchport trunk allowed vsan 1000 switchport trunk allowed vsan add 1010 switchport trunk allowed vsan add 1050 switchport trunk allowed vsan add 1900 switchport description To CCC215 10.33.81.52 switchport mode E vsan database vsan 1050 interface port-channel 1 vsan 1060 interface fc1/3 vsan 1060 interface fc1/4 vsan 1060 interface fc1/8 vsan 1050 interface fc1/12 vsan 1060 interface fc1/14 vsan 1060 interface fc1/15 vsan 1010 interface fc1/16 vsan 1900 interface fc2/1 vsan 1060 interface fc2/3 vsan 1010 interface fc2/4 vsan 1050 interface fc2/7
to a format where I can obtain the;
interface port-channel {Number} = switchport description To {CCCswitch +_number, i.e either CCC215 or CCC219}
I tried splitting like so
if ($Info =~ /show running-config/) { my @array = (split /^\n+$/,$Info); #for my $stuff (@array) #{ #print "$stuff\n"; #} #$var1= $1, next if (/(interface port-channel \d+)$/); print "$array[1]\n"; } }
But what I got was the whole log file as one array element!

I can't see how can I split the damn thing wat all!...Any Help please.

Thanks

Blackadder ############ UPDATE ###############

I am trying this now,...Not sure if its going to work.
my ($var1, $var2); if ($Info =~ /show running-config/) { $var1 = $1, next if (/(interface port-channel \d+)$/); $var2->{$var1}->{$1} = $2 if (m|(description to CCC\d+/\d+)\s+\[(\w+)\ +]|); print "::$1\n"; }
I didn't get any out put this time...Himmmmmmmm!!!

In reply to Another Challenge: Splitting data into chunks part2 by blackadder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.