> On Nov 10, 2016, at 3:34 AM, jaceke <jac...@op.pl> wrote:
> 
> I would like as argument of function use path with special characters then '' 
> are needed.
> That's why function adding apostrophe but after adding apostrofe file cannot 
> be found.

If the string value of the scalar variable that is passed to the subroutine 
contains special characters, those characters will be used as part of the file 
path. You do not need to surround the string with single or double quote 
characters to have those special characters interpreted by the operating system 
or file system.

You will need double-quote characters if you are trying to generate a string 
value with special characters within the source code of your program as a 
literal string.

> 
> For me it's strange why after declaration "my $f2 = '/etc/passwd';" paht can 
> be found but after adding apostrophe like that "$f1 = "'" . $f1 . "'";" paht 
> cannot be found.

That is because the apostrophe characters become part of the path string — not 
what you want.



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to