oh-my-git/scripts/fake-editor

18 lines
532 B
Plaintext
Raw Normal View History

2020-09-09 18:32:57 +02:00
#!/usr/bin/env perl
2020-09-09 18:32:57 +02:00
use IO::Socket;
$socket = IO::Socket::INET->new(PeerAddr => "127.0.0.1",
PeerPort => 1234,
Proto => "tcp",
Type => SOCK_STREAM);
# Send the length of the first argument as a byte.
$socket->send(chr(length($ARGV[0])));
# Send the first argument as a string.
$socket->send($ARGV[0]);
# This call is intended to block, we're waiting for Godot to close the connection.
2020-09-09 18:32:57 +02:00
my $reply;
$socket->read($reply, 1000);