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

Re^2: Ubuntu File Names with spaces and special characters

by Lotus1 (Vicar)
on Feb 27, 2019 at 15:56 UTC ( [id://1230621]=note: print w/replies, xml ) Need Help??


in reply to Re: Ubuntu File Names with spaces and special characters
in thread Ubuntu File Names with spaces and special characters

[...] Perl single quotes do not interpolate their contents, unlike the double quotes [...]

One fine point to add is that the delimiting character needs to be escaped in single quotes and the backslash itself will be escaped if there are two in a row.

use warnings; use strict; #my $y1 = ' \'; ## error my $y1 = ' \\'; ## produces ' \' #my $y2 = q{\}; ## error my $y2 = q{ \\}; ## produces ' \' my $y3 = q{\\share\dir\\}; ## produces '\share\dir\' my $y4 = ' \''; ## produces " '" my $y5 = q{ \}}; ## produces ' }' print "y1<$y1>\n"; print "y2<$y2>\n"; print "y3<$y3>\n"; print "y4<$y4>\n"; print "y5<$y5>\n"; __DATA__ y1< \> y2< \> y3<\share\dir\> y4< '> y5< }>

Replies are listed 'Best First'.
Re^3: Ubuntu File Names with spaces and special characters
by bliako (Monsignor) on Feb 28, 2019 at 11:38 UTC

    Thanks for adding that. Plenty of things I was not aware of.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-03-19 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found