From 4ba7259f6a60be3ba350d14b5682b9d99807aa57 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 22 Mar 2010 21:42:35 +0100 Subject: [PATCH] use constant instead of magic number --- lib/AnyEvent/I3.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/AnyEvent/I3.pm b/lib/AnyEvent/I3.pm index 2addeb34..e69604a8 100644 --- a/lib/AnyEvent/I3.pm +++ b/lib/AnyEvent/I3.pm @@ -167,7 +167,8 @@ sub subscribe { my ($self, $callbacks) = @_; my $payload = encode_json [ keys %{$callbacks} ]; - my $message = $magic . pack("LL", length($payload), 2) . $payload; + my $len = length($payload); + my $message = $magic . pack("LL", $len, TYPE_SUBSCRIBE) . $payload; $self->{ipchdl}->push_write($message); # Register callbacks for each message type -- 2.39.5