fixed Butts.pm to handle multi-liine inputs correctly
This commit is contained in:
parent
f11a159bce
commit
d237998a9d
2
Butts.pm
2
Butts.pm
|
@ -136,7 +136,7 @@ sub is_meme {
|
|||
sub split_preserving_whitespace {
|
||||
my ($string) = @_;
|
||||
|
||||
my ($leading_ws, $remainder) = ($string =~ m/^(\s*)(.*)$/);
|
||||
my ($leading_ws, $remainder) = ($string =~ m/^(\s*)(.*)$/s);
|
||||
$leading_ws //= '';
|
||||
|
||||
my @all_split = split(/(\s+)/, $remainder);
|
||||
|
|
|
@ -25,10 +25,8 @@ POE::Component::Server::TCP->new
|
|||
my ($kernel, $session, $heap, $input) = @_[KERNEL, SESSION, HEAP, ARG0];
|
||||
#print "Session ", $session->ID(), " got input: $input\n";
|
||||
|
||||
my @fortune = `$fortune`; # ick. But Fortune.pm is shit.
|
||||
foreach my $line (@fortune) {
|
||||
$heap->{client}->put($butter->buttify_string($line));
|
||||
}
|
||||
my $fortune_str = qx/$fortune/; # ick. But Fortune.pm is shit.
|
||||
$heap->{client}->put($butter->buttify_string($fortune_str));
|
||||
$kernel->yield("shutdown");
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue