-
-
Save bessarabov/c12a062692f78a0307e369e928e07b74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings FATAL => 'all'; | |
use feature qw(say); | |
use constant MY_CONSTANT => "42"; | |
use Cpanel::JSON::XS; | |
say encode_json { value => MY_CONSTANT }; | |
my $smth = 0 + MY_CONSTANT; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This output
But I would like to see in the output json the same type of the variable that I've used when defining constant, so in this case I expect to see
https://stackoverflow.com/questions/78124050/how-to-make-perl-number-constant-to-be-always-a-number-when-serializing-to-json