Thanks for the great advice.
I'm still stuck, though, on how to loop through this list from the calling sub.
sub TSM_Enquire { my $Slot, $Type, $Label; open(IN,"/bbs/rtscripts/adsm_cmd q libv|"); while (<IN>) { next unless (/3584/); s/,//; @Fields = split ' '; $Label = $Fields[2]; $Slot = $Fields[$#Fields-1]; $Type = $Fields[3]; push @List, "$Slot $Type $Label"; } close(IN); return @List; } sub Process_Columns { my $Count=0; my $Simple; my @Column_Info = ( [ 1024, 1067 ], # Column 1 start stop [ 1068, 1093 ], # Column 2 start stop [ 1094, 1137 ], # Column 3 start stop [ 1138, 1163 ], # Column 4 start stop [ 1164, 1207 ], # Column 5 start stop [ 1208, 1233 ], # Column 6 start stop [ 1234, 1277 ], # Column 7 start stop [ 1278, 1321 ] ); # Column 8 start stop if ($LibraryType =~ "tsm") { @List = TSM_Enquire; } else { @List = Tapeutil_Enquire; } for ($Count=1;$Count<=8;$Count++) { # Traverse columns my $StartPos = $Column_Info[$Count][1]; my $Pos = $StartPos; my $Column_Count = 0; my $EndPos = $Column_Info[$Count][2]; my $NewPos=0; my $NewLabel=""; my $NewRec=""; while ($NewRec = @List) { chomp $NewRec; $NewRec =~ s/^ //; ($Pos, $Type, $Label) = split(' ', $NewRec, 9999); for ($I=1;$I<=($EndPos-$StartPos)+1;$I++) { <snip>
I that the above is wrong (because it doesn't work, read as: doesn't do what I want).
Any ideas, comments, etc?
TIA
coec

In reply to Re: Re: Returning a list from a sub by coec
in thread Returning a list from a sub by coec

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.