mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-03 19:04:40 +01:00
16 lines
476 B
Perl
Executable file
16 lines
476 B
Perl
Executable file
#!/usr/bin/env perl
|
|
|
|
use IO::Socket;
|
|
use File::Spec;
|
|
|
|
$socket = IO::Socket::INET->new(PeerAddr => "127.0.0.1",
|
|
PeerPort => 1234,
|
|
Proto => "tcp",
|
|
Type => SOCK_STREAM);
|
|
|
|
my $absolute_path = File::Spec->rel2abs($ARGV[0]);
|
|
|
|
# Send the length of string as a byte.
|
|
$socket->send(chr(length($absolute_path)));
|
|
# Send the first argument as a string.
|
|
$socket->send($absolute_path);
|