Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Can I prevent JSON encode from converting values

by Your Mother (Bishop)
on Jul 20, 2012 at 21:06 UTC ( #982907=note: print w/replies, xml ) Need Help??

in reply to Can I prevent JSON encode from converting values

Upgrade? And ensure you've got JSON::XS. I've got 2.22.

perl -MJSON -le '$var = "5.0"; print JSON->new->allow_nonref->encode({ +$var => $var})' {"5.0":"5.0"}

Replies are listed 'Best First'.
Re^2: Can I prevent JSON encode from converting values
by somekindafreak (Acolyte) on Jul 20, 2012 at 22:14 UTC
    I have JSON::XS version 2.29. Perhaps I should downgrade? Actually I am developing for a static perl environment that I can't touch either way.

      I'm on 2.32 and get { "5.0": "5.0" }.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
        I did get this working in another perl env that has an updated version of JSON. Glad it is just a necessary rev. My is actually 2.21 with JSON::XS saying 2.29. In another location with 2.27 it does work perfectly. I will press for an update and manage until then. thanks everyone

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982907]
[marto]: configure whatever client you use to use a repositry you like?
[Corion]: usemodperl: Why would you want HTTP there? If you want/need to use wget without SSL libraries, set (or whatever) as your uplink?
[marto]: I suspect more trolling...
[usemodperl]: Because the audience for my apps have old, locked down versions of perl that can't install modules or update perl and now all that is horribly broken without HTTP. Of course I can go outside Perl anytime but that impacts portability
[usemodperl]: I can find cpan mirrors on http but not with plain files, only tar.gz, does something like meta exist on http?
[marto]: run your own mirror minicpan
[marto]: or just fatpack/package your apps
[Corion]: usemodperl: No. I think your approach to "downloading modules" is horribly misguided. I recommend you use the standard tools, and/or move your own tools to standard interfaces. Or maybe just set up your own plaintext mirror if that's what you need.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2018-06-24 16:17 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.