in reply to Determining content-length for an HTTP Post

Just to rule out an encoding issue: Have you tried using the bytes pragma?

Replies are listed 'Best First'.
Re^2: Determining content-length for an HTTP Post
by Anonymous Monk on Nov 25, 2009 at 17:49 UTC
    How would I go about using it?
      use bytes; my $length_in_bytes = length( $xmldata );
        If the problem is that he forgot to encode his XML, the solution is NOT to get the length of the internal representation of the XML, it's to encode the XML.
        use Encode qw( encode ); # Or whatever encoding you specified in <?xml?> $xmldata = encode('UTF-8', $xmldata); my $length = length( $xmldata );
        or
        utf8::encode( $xmldata ); my $length = length( $xmldata );