On Wed, Aug 22, 2012 at 10:39 AM, jet speed <speedj...@googlemail.com> wrote: > Hi All, > > Please advice me on now to capture the data below in the format as below. > > i thought of using hash, but then the problem is each DisplayDevNum has > multiple WWN. some has 4 elements, some has 2. Any other method ? > Apprecaite your comments. > > > i want to caputre in the below format. > DisplayDevNum and its corresponding WWN=10:00:00:00:c9:c9:xx:xx and > nickname= xxxxx > DisplayDevNum and its corresponding WWN=10:00:00:00:c9:c9:xx:xx and > nickname= xxxxx > > ---- > > DisplayDevNum=1D:D4 > domainID=7 > devNum=8,888 > List of 4 WWN elements > WWN=10:00:00:00:c9:c9:89:8c > nickname=res-abc > WWN=10:00:00:00:c9:c9:89:8b > nickname=res-abd > WWN=10:00:00:00:c9:c9:89:8a > nickname=res-a33 > WWN=10:00:00:00:c9:c9:89:8i > nickname=res-34 > DisplayDevNum=1D:D9 > domainID=7 > devNum=8,888 > List of 2 WWN elements > WWN=10:00:00:00:c8:c9:89:8f > nickname=res-a1 > WWN=10:00:00:00:c9:c9:89:81 > nickname=res-a33 > > Sj
You can still use a hash. You want a hash of arrays (see perldoc perldsc; or search for perldsc on the web; or search for Perl hash of arrays). HTH, Ken -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/