Bestest Monks

I am trying to creat a data structure like;
San device : SAN3 Lun Name : LUNName3 WW Names : 60:05:08:b2:00:bb:b6:93 60:05:08:b2:00:bb:b6:92 San device : SAN4 Lun Name : LUNName4 WW Names : 66:05:08:b2:00:7d:15:13 66:05:08:b2:00:7d:15:12 66:01:43:80:00:be:79:12 66:01:43:80:00:be:79:10
And so forth...

I wrote this bit of code which is not working!
my $xls_path = "c:/path_to_xls.xlsx"; my $xls = $excel->Workbooks->Open("$xls_path"); foreach my $sheet ( in $xls->Worksheets ) { $San ={}; $San->{name} = $sheet->Name, $/; my $San_data = $xls->Worksheets("$San->{name}"); my @Colum_A = $San_data->UsedRange->{'Value'}; if ( "$Colum_A[0]" =~ /ARRAY/) { $San->{note} = 'Live SAN Box'; foreach my $array (@{$Colum_A[0]}) { foreach (@$array) { my @wwn; next if ((uc $_) eq (uc "$San->{name}")); next if not defined $_; push (@{$San->{LUNs}},$_) if ($_ !~ /:/); foreach my $LUN (@{$San->{LUNs}}) { print "\n".$LUN.": ".$_."\n" if ($_ =~ /:/); } } } } else { $San->{note} = $Colum_A[0]; } #print Dumper $San; print "\n__________\n"; } __DATA__ LUNName1 60:05:08:b2:00:bb:b6:93 60:05:08:b2:00:bb:b6:92 LUNName1 66:05:08:b2:00:7d:15:13 66:05:08:b2:00:7d:15:12 66:01:43:80:00:be:79:12 66:01:43:80:00:be:79:10 LUNName3 66:05:08:b2:00:b2:95:23 66:05:08:b2:00:b2:95:22 66:05:08:b2:00:b2:ab:a3 89:05:08:b2:00:b2:ab:a2 89:05:08:b2:00:b2:b4:c3 89:05:08:b2:00:b2:b4:c2 LUNName4 89:05:08:b2:00:b2:36:c2 89:05:08:b2:00:b9:fa:13 89:05:08:b2:00:7c:bc:03 98:05:08:b2:00:b9:fa:12 70:05:08:b2:00:7c:bc:02 70:05:08:b2:00:b2:2c:b3 70:05:08:b2:00:b2:2c:b2 70:05:08:b2:00:75:6d:73
can someone pretty please advise how can I creat such data structures from the __DATA__ that I have?

In Fact; I don't slurp the data in, I populate an array direct from excel with
my @Colum_A = $San_data->UsedRange->{'Value'};
so I think this would be better
@Colum_A = qw/LUNName1 60:05:08:b2:00:bb:b6:93 60:05:08:b2:00:bb:b6:92 LUNName1 66:05:08:b2:00:7d:15:13 66:05:08:b2:00:7d:15:12 66:01:43:80:00:be:79:12 66:01:43:80:00:be:79:10 LUNName3 66:05:08:b2:00:b2:95:23 66:05:08:b2:00:b2:95:22 66:05:08:b2:00:b2:ab:a3 89:05:08:b2:00:b2:ab:a2 89:05:08:b2:00:b2:b4:c3 89:05:08:b2:00:b2:b4:c2 LUNName4 89:05:08:b2:00:b2:36:c2 89:05:08:b2:00:b9:fa:13 89:05:08:b2:00:7c:bc:03 98:05:08:b2:00:b9:fa:12 70:05:08:b2:00:7c:bc:02 70:05:08:b2:00:b2:2c:b3 70:05:08:b2:00:b2:2c:b2 70:05:08:b2:00:75:6d:73/;
Thanks

Blackadder

In reply to Creating a table from raw data! 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.