| | |
passing a path variable to system()
Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Sep 2009
Posts: 5
Reputation:
Solved Threads: 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
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
![]() |
Similar Threads
- how to read unix profile variable into Perl (Perl)
- wanted to read a unix PATH variable into perl script (Perl)
- path variable in tsh (Getting Started and Choosing a Distro)
- C# help please (C#)
- C++ system (cmd) and variable (C++)
- Oracle 9i Java RE problem (Oracle)
- Passing formname as variable (Visual Basic 4 / 5 / 6)
- Help with dates (C)
- How Can I Pass A PHP Variable From One .php page to another (PHP)
Other Threads in the Perl Forum
- Previous Thread: Difference between Dates
- Next Thread: How to copy a directory?
| Thread Tools | Search this Thread |





