Re: Ascending numbers

2007-03-04 Thread Jeff Pang
> >Hi Jeff Ji, your program worked. But i couldn't understand the second >line.. That long print statement. What happened there? My 'simple' >sort arranged numbers in dictionary style.. Like 0 then 1 then 17 then >2 and then 29.. And how come in using strict module, that $a and $b >didnt make any

Re: Ascending numbers

2007-03-04 Thread Somu
Hi Jeff Ji, your program worked. But i couldn't understand the second line.. That long print statement. What happened there? My 'simple' sort arranged numbers in dictionary style.. Like 0 then 1 then 17 then 2 and then 29.. And how come in using strict module, that $a and $b didnt make any noise?

Re: Ascending numbers

2007-03-04 Thread Tom Phoenix
On 3/4/07, Somu <[EMAIL PROTECTED]> wrote: I'm unable to arrange the numbers in an array in ascending order.. I tried the following @asc = sort{$a<=>$b} @list; but it didnt work. It works for me. What are you doing differently? Can you reduce your problem to a small test case that you can po

Re: Ascending numbers

2007-03-04 Thread Jeff Pang
> >I'm unable to arrange the numbers in an array in ascending order.. I >tried the following > >@asc = sort{$a<=>$b} @list; > >but it didnt work. I did a subroutine > What's your array's content? It do can work using Perl's sort (see below),also please see 'perldoc -f sort'. $ perl -le '@arr =

Ascending numbers

2007-03-04 Thread Somu
I'm unable to arrange the numbers in an array in ascending order.. I tried the following @asc = sort{$a<=>$b} @list; but it didnt work. I did a subroutine sub con{ my ($a,$b); $a<=>$b;} Then i tried @asc = sort con @list; #didnt work Can anyone please help? -- Love, Somu, http://lose.yourself