Ed wrote:

:     my @lineArray;
:     while(<F>)
:     {
:       # if the line is a net localgroup line add it to the array
:       if( $_ =~ $s_criteria )

    You probably should be testing against a regular expression.

    if ( $_ =~ /$s_criteria/ )

    Or just:

    if ( /$s_criteria/ )


:       {
:           print "FOUND localgroup line:-> $_\n";
:           split /\s/;

    This form of split() is deprecated. You should be receiving
an error for this.


:           push( @lineArray,  @_  );  <---no it's an array of arrays.

    An array of arrays is a short name for an array of array
references. Array elements can only hold scalar values and arrays
are not scalars. References to arrays are scalars.

    push @lineArray, [EMAIL PROTECTED];

    Or:

    push @lineArray, [EMAIL PROTECTED];


    Or bypassing the deprecated form of split():

    push @lineArray, [ split ' ' ];



: #         print @lineArray;
:         }
: 
: Can someone set me straight or provide an alternate method?


use strict;
use warnings;
        .
        .
        .

my @unsorted;
while ( <F> ) {
    push @unsorted, [ split ' ' ] if /$s_criteria/;
}



    Once you actually get an array of arrays you can try the
Sort::ArrayOfArrays module to sort it.



HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to