X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlport.pod;h=ffd7c863b32eede5b1c99252031f2d742f79e90c;hb=28b41a8090d259cff9b1dd87c0c53b3c4a31e822;hp=73a66168610ac0add26aea9d3b169fcca37b7f97;hpb=0d53b15fa4cfc19af1f1f60c6ad17eac8f14cce3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlport.pod b/pod/perlport.pod index 73a6616..ffd7c86 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -224,6 +224,10 @@ them in big-endian mode. To avoid this problem in network (socket) connections use the C and C formats C and C, the "network" orders. These are guaranteed to be portable. +As of perl 5.9.2, you can also use the C> and C> modifiers +to force big- or little-endian byte-order. This is useful if you want +to store signed integers or 64-bit integers, for example. + You can explore the endianness of your platform by unpacking a data structure packed in native format such as: @@ -494,13 +498,35 @@ Don't assume that you can reach the public Internet. Don't assume that there is only one way to get through firewalls to the public Internet. +Don't assume that you can reach outside world through any other port +than 80, or some web proxy. ftp is blocked by many firewalls. + +Don't assume that you can send email by connecting to the local SMTP port. + Don't assume that you can reach yourself or any node by the name -'localhost'. The same goes for '127.0.0.1'. +'localhost'. The same goes for '127.0.0.1'. You will have to try both. -Don't assume that any particular port (service) will respond. +Don't assume that the host has only one network card, or that it +can't bind to many virtual IP addresses. + +Don't assume a particular network device name. + +Don't assume a particular set of ioctl()s will work. Don't assume that you can ping hosts and get replies. +Don't assume that any particular port (service) will respond. + +Don't assume that Sys::Hostname() (or any other API or command) +returns either a fully qualified hostname or a non-qualified hostname: +it all depends on how the system had been configured. Also remember +things like DHCP and NAT-- the hostname you get back might not be very +useful. + +All the above "don't":s may look daunting, and they are -- but the key +is to degrade gracefully if one cannot reach the particular network +service one wants. Croaking or hanging do not look very professional. + =head2 Interprocess Communication (IPC) In general, don't directly access the system in code meant to be @@ -1080,7 +1106,7 @@ native formats. What C<\n> represents depends on the type of file opened. It usually represents C<\012> but it could also be C<\015>, C<\012>, C<\015\012>, -C<\000>, C<\040>, or nothing depending on the file organiztion and +C<\000>, C<\040>, or nothing depending on the file organization and record format. The VMS::Stdio module provides access to the special fopen() requirements of files with unusual attributes on VMS. @@ -1503,12 +1529,6 @@ suffixes. C<-S> is meaningless. (Win32) C<-x> (or C<-X>) determine if a file has an executable file type. (S) -=item alarm SECONDS - -=item alarm - -Not implemented. (Win32) - =item binmode FILEHANDLE Meaningless. (S, S)