Code A #!/usr/bin/perl use strict; my @string = qw(a a b h a g s j s z u u e); my @a = Suff(@string); print "@a\n"; #so here i should get numbers form 0..18 or something use Inline C => <<'END_OF_C_CODE'; #include #include #include #include void Suff(SV* array, ...){ int i,n; Inline_Stack_Vars; n = Inline_Stack_Items; char **sarray; sarray = (char **)malloc(n * sizeof(char *)); char *string[Inline_Stack_Items]; for (i = 0; i < n; i++){ string[i] = SvPV(Inline_Stack_Item(i), PL_na); printf("%s",string[i]); // it prints characters instead of strings } for(i=0;i