Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: System substitution

by LTjake (Prior)
on Nov 20, 2002 at 12:34 UTC ( [id://214413]=note: print w/replies, xml ) Need Help??


in reply to System substitution

When i run your program, i get the following output (on win2k):
$ENV{TYPE}='c:\my test\type me'; $new_debug_log='c:\my test\type me.bat'; $rc = system("\"$ENV{TYPE}\" \"$new_debug_log\""); __output__ @echo off @type %1
That seems right to me, type prints out the contents of the file, and that happens to be the contents of that file. I would probably use the q() command instead of escaping things.
$ENV{TYPE} = q("c:\my test\type me"); $new_debug_log = q("c:\my test\type me.bat"); $rc = system("$ENV{TYPE} $new_debug_log"); __output__ @echo off @type %1
HTH

--
Rock is dead. Long live paper and scissors!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-03-19 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found