Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Single Quotes - how to avoid any escape processing?

by temporal (Pilgrim)
on Jan 31, 2013 at 20:59 UTC ( #1016392=note: print w/ replies, xml ) Need Help??


in reply to Single Quotes - how to avoid any escape processing?

Thanks for the replies guys.

Yes, it would appear that (for the Googlers) this is not possible.
At least not in any simple, straightforward method that I was hoping for.

ww, I did check out that section of the PerlDocs - it told me about what I was expecting.
However the reread led me to this (appropriately christened!) section of the same doc which definitively spells everything out about this case, and many others not even considered in this node:

http://perldoc.perl.org/perlop.html#Gory-details-of-parsing-quoted-constructs

This is one of the rare cases where Perl's DWIM philosophy doesn't align with my own, oh well.

A (basic) note - the selected delimiter for q{} is always vulnerable and needful of and being escaped. As you'd expect.

And thanks for the quality snippets LanX, that is probably what I'd end up doing if I had a long list. Fortunately, this time I was just curious about that case =)
Hehe, I certainly don't blame Perl for MS monkey business. The scary part is that I'm starting to get used to it. Boy, sometimes I miss my last position where I worked primarily with Linux-based systems ;)

Of course, moritz offers another good solution for larger volumes of data as well ♥

So thanks again monks.
Hopefully this node will stand as an answer, of sorts (heh, ww =D )

Strange things are afoot at the Circle-K.


Comment on Re: Single Quotes - how to avoid any escape processing?
Download Code
Re^2: Single Quotes - how to avoid any escape processing?
by BillKSmith (Chaplain) on Jan 31, 2013 at 21:40 UTC

    Things get even worse when you windows path includes whitespace. (e.g. c:\Documents and Settings\.....). Windows requires quotes around the path. Those quotes must be part of the perl string. The section of documentation that you just cited has everything you need to know, but it is not easy.

    Bill

      Oh yeah, fun stuff. I think at that point I'd start using one of the path parsing/porting modules to handle it all.

      iirc File::Path and File::Basename intelligently handle paths with spaces on Windows.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2014-10-01 22:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (40 votes), past polls