0

Hi all,

I am new to Perl. I am trying to send a variable which contains the location of my executable (eg: C:\temp) to system function. i initialized the variable as,
my var1="C:\\temp";
when i print this line i got : C:\temp as o/p.
To start the executable i did:
system("$var1//executable.exe");
I thought, var1 is replaced with C:\temp, but not with C:\\temp
If i don't provide C:\\temp\\executable.exe to system(), the execution is not started.
I want to send a variable with two slashes to system function. Help me here. Or suggest me any work around

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by rdevi
0

This will work in one of two ways


Change to:
my var1="C:\\\\temp";

And the do what you're doing.

Or, change to
my var1="C:/temp";

Which should work as well.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.