in reply to use bytes vs packed data

BTW, I just noticed encoding::warnings. Might be useful here?

Replies are listed 'Best First'.
Re^2: use bytes vs packed data
by RDOlson (Initiate) on May 03, 2011 at 15:49 UTC

    Interesting, it seems it would be but when I turn off use bytes and add use encoding::warnings I get the incorrect behavior with no warnings.

    The code fragment where this is happening is as follows, in case it helps. $conn is a Net::RabbitMQ connection object. $params is a FCGI parameters hash. $packed_data is the string that is getting munged.

    my $s = YAML::Dump($params); print "pack length " . length($s) . "\n"; my $packed_data = pack("N/aN/a", $s, $in); $conn->publish($channel, "rpc.$function", $packed_data, { exchange => $exchange_name }, { content_type => $type, correlation_id => $uuid_str, reply_to => $queue_name, });
      There is a function to find out whether the string is stored as utf8 or 8-bit, but I can't remember what it's called. You might try exploring the different values and see.