Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings generated when serializing undef #28

Open
EvanCarroll opened this issue May 16, 2024 · 5 comments
Open

Warnings generated when serializing undef #28

EvanCarroll opened this issue May 16, 2024 · 5 comments

Comments

@EvanCarroll
Copy link

May want to silence these.

Use of uninitialized value $data in pattern match (m//) at /opt/cpanel/perl5/536/site_lib/TOML/Tiny/Writer.pm line 73.
Use of uninitialized value $data in pattern match (m//) at /opt/cpanel/perl5/536/site_lib/TOML/Tiny/Writer.pm line 74.
Use of uninitialized value $arg in substitution (s///) at /opt/cpanel/perl5/536/site_lib/TOML/Tiny/Writer.pm line 212.
Use of uninitialized value $arg in substitution (s///) at /opt/cpanel/perl5/536/site_lib/TOML/Tiny/Writer.pm line 213.
Use of uninitialized value $arg in concatenation (.) or string at /opt/cpanel/perl5/536/site_lib/TOML/Tiny/Writer.pm line 215.
@oalders
Copy link
Collaborator

oalders commented May 16, 2024

Is there a minimal case to reproduce this?

@EvanCarroll
Copy link
Author

EvanCarroll commented May 16, 2024

use TOML::Tiny;

my $db = { 
          'mysql' => {
                       'host' => '127.0.0.1',
                       'socket' => undef
                     }
        };

my $p = TOML::Tiny->new( strict => 1 );
print $p->encode($db);

It does not like values set to undef

@oalders
Copy link
Collaborator

oalders commented May 16, 2024

Does the TOML spec allow for undef?

@EvanCarroll
Copy link
Author

EvanCarroll commented May 16, 2024

No, so I would think you could handle it by providing a mapping function, replacement string, or just dying and saying "we don't handle undef, and neither does TOML". But, I wouldn't generate warnings from inside the library.

@oalders
Copy link
Collaborator

oalders commented May 16, 2024

Ok, thanks! I'm not really invested in this module right now, but if someone comes along with a PR I'm happy to deal with that.

@EvanCarroll EvanCarroll changed the title Warnings generated. Warnings generated when serializing undef May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants