$Device

$D[EVICE] reflects the status of the current device. If the status of the device does not reflect any error-condition, the value of $DEVICE, when interpreted as a truth-value is 0 (FALSE). If the status of the device reflect any error-condition, the value of $DEVICE, when interpreted as a truth-value is 1 (TRUE).

[Note]

The initial value of $DEVICE is implementation dependant. However, if the initial value of $IO is the empty string, then the initial value of $DEVICE is also empty string.

$DEVICE gives status code and meaning, in one access:

Example:

    1,Connection reset by peer
    

The above message is displayed on the server side when the socket device is closed on the client side.