my $ref = [ 5.0e-5,4.2e-5,4.3e-5,4.4e-5,4.4e-5,4.2e-5,4.2e-5,4.0e-5]; use Inline C => <<'END_OF_C_CODE'; void test(SV* sv, ...) { I32 i; I32 arrayLen; AV* data; float retval; SV** pvalue; Inline_Stack_Vars; data = SvUV(Inline_Stack_Item(0)); /* Determine the length of the array */ arrayLen = av_len(data); // sort sortsv(AvARRAY(data),arrayLen+1,Perl_sv_cmp_locale); for (i = 0; i < arrayLen+1; i++) { pvalue = av_fetch(data,i,0); /* fetch the scalar located at i .*/ retval = SvNV(*pvalue); /* dereference the scalar into a number. */ printf("%f \n",newSVnv(retval)); } } END_OF_C_CODE