Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Sereal-Encoder CPAN distribution.

Report information
The Basics

Nobody in particular
zefram [...]

(no value)
Broken in:
(no value)
Fixed in:
(no value)

MIME-Version: 1.0
X-Spam-Status: No, score=-2.214 tagged_above=-99.9 required=10 tests=[AWL=-0.303, BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Content-Disposition: inline
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"
Message-ID: <>
X-Virus-Scanned: Debian amavisd-new at
X-Spam-Score: -2.214
Received: from localhost (localhost []) by (Postfix) with ESMTP id 6F3372400E1 for <>; Wed, 4 Feb 2015 07:59:30 -0500 (EST)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id vSAB+NG+PL4W for <>; Wed, 4 Feb 2015 07:59:28 -0500 (EST)
Received: from ( []) by (Postfix) with SMTP id 7D5B02400D2 for <>; Wed, 4 Feb 2015 07:59:28 -0500 (EST)
Received: (qmail 29135 invoked by alias); 4 Feb 2015 12:59:28 -0000
Received: from (HELO ( by (qpsmtpd/0.28) with ESMTP; Wed, 04 Feb 2015 04:59:25 -0800
Received: from zefram by with local (Exim 4.80 #2 (Debian)) id 1YIzY5-0003Wg-6m; Wed, 04 Feb 2015 12:59:17 +0000
Subject: bitwise behaviour not preserved
Return-Path: <>
X-RT-Mail-Extension: sereal-encoder
Date: Wed, 4 Feb 2015 12:59:17 +0000
From: Zefram <>
X-RT-Original-Encoding: ascii
X-RT-Interface: Email
Content-Length: 1338
$ perl -MSereal::Encoder=encode_sereal -MSereal::Decoder=decode_sereal -MTest::More=no_plan -MDevel::Peek -lwe 'sub roundtrip_ok { ok +(decode_sereal(encode_sereal($_[0])) ^ "1") eq ($_[0] ^ "1"); } roundtrip_ok 1; roundtrip_ok "1"; my $a = "1"; my $b = $a+0; my $c = $a+0.5; roundtrip_ok $a' ok 1 ok 2 not ok 3 # Failed test at -e line 1. 1..3 # Looks like you failed 1 test of 3. This is testing whether scalars are treated as numbers or as strings for the purposes of bitwise ops. This is a visible feature of a scalar, which Sereal should probably preserve. Internally the test is actually SvNIOK(). Sereal preserves this status for most scalars, but a scalar that is simultaneously IOK, NOK, and POK comes out POK-only, thus changing its SvNIOK() status. Obviously, this interacts with whatever is done for [ #101876]. Simple fixes for that cause the bitwise-roundtrip test to fail in more cases. Preserving bitwise status while also preserving string value would require essentially passing at least one NIOK bit alongside a string value, which would require a protocol addition. If the protocol is going to be changed in this area, it might be wise to extend it to full dualvar handling at the same time. If you'd rather not have Sereal preserve bitwise status, this limitation should be documented. -zefram

This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with to