my $base64 = encode_base64(""); #### $sock->send("$base64\n") or die "Can't write to $socket"; #### $sock->send("$base64\n") or die "Can't write to $socket"; #### encode_base64($str, $eol); Encode data by calling the encode_base64() function. The first argument is the string to encode. The second argument is the line-ending sequence to use. It is optional and defaults to "\n".