Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to use Perl to send me an smbclient message. somethng like: #!/usr/bin/perl 'smbclient -M acomputer'; $_ ="Ping failed"; ^D; I am unable to figure out how to encode the control-D bit so the messsage can be sent. Ultimately, I have a little script which pings a critical machine and I want a popup message when it fails to connect. I have succeeded in the first part, now ned to complete the second bit. Please show me the way. regards, Mat Fulton

Replies are listed 'Best First'.
Re: encoding control-D
by chromatic (Archbishop) on Mar 18, 2000 at 22:45 UTC
    Quoting from the Camel, 2nd Edition, page 65:

    A backslashed c followed by a single character, such as \cD, matches the corresponding control character.