Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to escape single quote(s) without the use of quotemeta (Data::Dumper)

by LanX (Saint)
on Apr 05, 2019 at 15:54 UTC ( [id://1232200]=note: print w/replies, xml ) Need Help??


in reply to How to escape single quote(s) without the use of quotemeta

quotemeta is meant for regex metas which form a super-set of "string metas".

But what about the stringyfications from Data::Dumper (single quote) or Data::Dump (double quote)?

DB<62> use Data::Dumper qw/Dumper/ DB<63> $Data::Dumper::Terse = 1; DB<64> $x= Dumper q(It's\x\\) DB<65> print "<<<$x>>>" <<<'It\'s\\x\\' >>> DB<66> chomp $x DB<67> $x =~ s/^'(.*)'$/$1/ DB<68> print "<<<$x>>>" <<<It\'s\\x\\>>> DB<69>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

edit

NB: If you wanna use $Data::Dumper::Terse think of localizing it or use the OO interface ...

  • Comment on Re: How to escape single quote(s) without the use of quotemeta (Data::Dumper)
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-24 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found