use warnings;
use strict;
+use Data::Dump qw(dump);
+
use IO::Socket::INET;
$| = 1;
while ($client_socket->connected) {
my $line = <$client_socket>;
- chomp $line;
+ $line =~ s/[\r\n]+$//;
+
warn "<< $line\n";
if ( $line =~ m/^\.SQ ([\d\.]+) (\S+)/ ) {
} elsif ( $line =~ m/\.SERVER LIST/ ) {
client_send ".ERROR NO-ENTERPRISE";
} elsif ( $line =~ m/\.CARD (\S+)/ ) {
- client_send ".CARD OK pero peric (pero\@example.com)";
+ client_send ".CARD OK Ime Prezime (nobody\@example.com)";
} elsif ( $line =~ m/\.ACTION$/ ) {
- client_send ".ACTION CMENUS2";
+ client_send ".ACTION CMENUS0"; # FIXME can be CMENUS2
} elsif ( $line =~ m/\.ACTION COPY/ ) {
client_send ".ACTION COPY";
client_send ".COPY Mozete kopirati (pero)";
} elsif ( $line =~ m/(\.NOP)/ ) {
client_send "$1";
} else {
- die "unknown: $line";
+ die "UNKNOWN: ",dump($line);
}
}
}