From: Michael Stapelberg Date: Mon, 22 Mar 2010 20:42:35 +0000 (+0100) Subject: use constant instead of magic number X-Git-Tag: 4.14~14^2~44 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4ba7259f6a60be3ba350d14b5682b9d99807aa57;p=i3%2Fi3 use constant instead of magic number --- 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