Interview Questions

What are differences between Perl and C socket functions?

Perl, Sockets and TCP/IP Networking


(Continued from previous question...)

What are differences between Perl and C socket functions?

the socket functions in C, they'll look quite familiar in Perl. The basic functions include socket, connect, bind, listen, and accept. Perl also has versions of functions like gethostbyname and getprotobyname, which make socket communication much easier. These Perl functions, of course, eventually invoke the C versions, so the argument lists are quite similar. The only differences arise because Perl file handles aren't the same as C file descriptors (which are just integers) and the Perl versions don't need the additional lengthy arguments for strings or structures.

(Continued on next question...)

Other Interview Questions