Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Unescaping JavaScript string (encode/decode)

by Anonymous Monk
on Mar 18, 2016 at 04:32 UTC ( #1158188=note: print w/replies, xml ) Need Help??


in reply to Unescaping JavaScript string

use JavaScript::HashRef::Decode

#!/usr/bin/perl -- use strict; use warnings; use JavaScript::HashRef::Decode qw/ decode_js /; my $string = q{'https\x3a\x2f\x2fexample.com'}; my $js_hash = "{it:$string}";; my $fromJs = decode_js( $js_hash ) ; dd( $string, $js_hash, $fromJs ); dd( $fromJs->{it} ); __END__ ( "'https\\x3a\\x2f\\x2fexample.com'", "{it:'https\\x3a\\x2f\\x2fexample.com'}", { it => "https://example.com" }, ) "https://example.com"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1158188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2022-01-17 17:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (51 votes). Check out past polls.

    Notices?