Re: missing curly - brain fried

2007-06-28 Thread Tom Phoenix
On 6/28/07, Amichai Teumim <[EMAIL PROTECTED]> wrote: Where is the open curly missing here? Here it is: @array = sort { $a <=> $b } @array; But if you really want to do it the hard, slow way Well, then you should be programming this as a shell script. But let's at least translate your

Re: missing curly - brain fried

2007-06-28 Thread jbuburuz
> Where is the open curly missing here? > > #!/usr/bin/perl > > @array = (5,3,2,1,4); > > > for ($i=0; $i<$n-1; $i++) { I think its missing on the line bellow. I count three brackets bellow. > ( for ($j=0; $j<$n-1-$i; $j++) > > > if ($array[$j+1] < $array[$j]) { /* compare the two neighbors > *

Re: missing curly - brain fried

2007-06-28 Thread Martin Barth
Hi Amichai, first of all never write own code without these two lines: use strict; use warnings; this should allways help a lot. Remember the e-mail from Chas Owens regarding the "shuffling cards". making comments in perl goes this way: # hello, i am a comment. you made C-style comments: //,

missing curly - brain fried

2007-06-28 Thread Amichai Teumim
Where is the open curly missing here? #!/usr/bin/perl @array = (5,3,2,1,4); for ($i=0; $i<$n-1; $i++) { ( for ($j=0; $j<$n-1-$i; $j++) if ($array[$j+1] < $array[$j]) { /* compare the two neighbors */ $tmp = $array[$j]; /* swap $array[j] and $array[j+1] */ $array[$j] = $a