use v5.10; use Inline 'C'; say "At least we have compiled a bit of C code!"; my $output = enctypex_msname("HD2"); say "Output from enctypex_msname() call: $output\n"; =OUTPUT: At least we have compiled a bit of C code! Output from enctypex_msname() call: HD2.ms14.host.com =cut __END__ __C__ SV *enctypex_msname (unsigned char *name) { unsigned int c; unsigned char* mover; if(!*name) return(NULL); /* empty string "" */ /* not sure if this will result in undef?? */ unsigned int server_num = 0; for( mover = name; *mover; mover++) { c = tolower(*mover); server_num = c - (server_num * 0x63306ce7); /*some comment appropriate here!!*/ } server_num %= 20; return (newSVpvf("%s.ms%d.host.com", name, server_num)); // malloc is here... // temp allocation here too }