icarus wrote:
> Thanks Rob and Martin for your inputs.
>
> I found a solution to my problem.  I'm posting it here for whoever
> might need it.  I'm sure there's a faster solution out there but this
> will do just fine.
> I had to put the files in an array. :(
> The reason is that you cannot sort a scalar [ or scalar context such
> as reading a dir using while (<MYDIR>) ] , it has to be an array.
>
>   
A scalar is fundamentally a single value.  Sorting a single value is not
particularly useful (I can't think of any alternate orderings aside from
the one value first (or last if you're a pessimist)).   Sorting a list
of values is far more useful...arrays certainly also help but you could
also keep things outside of arrays and purely in list context though it
would likely involve a lot more typing and/or control structures. 

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


Reply via email to