Skip to content

Serialize strings as strings #3

@NachoBracho

Description

@NachoBracho

Hi, one of the main reasons to use this nice module is to be compatible with PHP oriented developments. And it seems that serialization in PHP implies that a string must remain as a string after serialization.

$result = serialize({ a => '1111', b => '2222'});
# IT GIVES ME 'a:2:{s:1:"a";i:1111;s:1:"b";i:2222;}’;

Strings are converted to integers, no matter what trick is used in the original data.

I solved it with the help obtained at https://stackoverflow.com/questions/66331974/i-need-to-serialize-in-perl-with-php-format, but it is a pity to rewire or subclass the module for this alone.

For example, this behavior is a must in an API like this: https://developer.paddle.com/webhook-reference/verifying-webhooks All data must be converted to strings before the signature verification, and remain as strings.

As usual there are no Perl examples it the API, and the only missing piece to use it in Perl is the serialization.

It should be great an update to be more compatible with APIs writer with a PHP point of view.

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions