Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl Net::Jabber::Bot new line

Tags:

newline

perl

xmpp

I'm using Net::Jabber::Bot module in my Perl script and it works properly but one problem is that when I want to send a message all new lines get removed! Two questions :

  1. How we can have new lines in our messages? Should we disable achomp somewhere?
  2. What happens with new lines in Jabber/XMPP?
like image 731
Mehrdad Avatar asked Dec 06 '12 18:12

Mehrdad


1 Answers

This is a known issue, somebody already submitted a patch for this: http://code.google.com/p/perl-net-jabber-bot/issues/detail?id=24

You are not able to send \n directly but you maybe able to send xmpp/jabber coded newline if that code does not contain unprintable chars.

In this sub:

sub _send_individual_message {
...
# Strip out anything that's not a printable character
# Now with unicode support?
$message_chunk =~ s/[^[:print:]]+/./xmsg; 
like image 60
user1126070 Avatar answered Oct 14 '22 19:10

user1126070