"R. Joseph Newton" wrote:

Correction inline.  Forgot the start param for substr()

> "Dennis G. Wicks" wrote:
>
> > Greetings;
> >
> > I have a file that I need to sort and currently I am just
> > sorting it by
> >
> >       @datalist = sort(@datalist);
>
> Try this:
>
> >       @articles = sort {substr($a, 0, 6) + 0 <=> substr($b, 0, 6)
> + 0}
> > @files;
> >
> > but I can't figure out how to tell the sort that $a and $b
> > are the first six characters of @datalist. That is numeric
> > data BTW.
>
> Joseph
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>


-- 
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