Try using the %ENV hash. system("expand perfc009.DA_ $ENV{WINDIR}\\system32\\perfc009.DAT") && die "no $!";
-----Original Message----- From: Rosenstein, Leon [mailto:[EMAIL PROTECTED] Sent: Monday, March 24, 2003 10:58 AM To: '[EMAIL PROTECTED]' Subject: \ vs / vs % -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi everyone, I am pretty new to perl so I assume you guys and girls will starting getting to know me really well. I have a one line snippet of code that I am trying to run. The system is win2k sp3. I am trying to run the expand command and pass to it some arguments that contain system variables. The code: #Ok we have renamed the files now we need to run the expand command: system("expand perfc009.DA_ %windir%\\system32\\perfc009.DAT") && die "no $!"; and when I run I get it: C:\Perf>perl -w maintest.pl.txt Microsoft (R) File Expansion Utility Version 5.00.2134.1 Copyright (C) Microsoft Corp 1990-1999. All rights reserved. Expanding perfc009.da_ to %windir%\system32\perfc009.dat. Can't open output file: %windir%\system32\perfc009.dat. no at maintest.pl.txt line 5. My first question is; did I do the right thing by putting a \ before the \ in the path? My second question is whether or not the % sign is messing things up? Finally I am wondering how best to solve this? DO you think hard coding the actual path (instead of using %windir% would help? Thx again! Leon -----BEGIN PGP SIGNATURE----- Version: PGP 8.0 iQA/AwUBPn9VR0k2S2y0JhBMEQJUewCfRsOIXFTIzWI1Unpo85aw2PWExRgAnRWO uxuuRslvggSiFyE3bbJYHj7u =9xua -----END PGP SIGNATURE----- INDEPENDENCE COMMUNITY BANK CONFIDENTIALITY NOTICE: This message (and any attachment) is confidential and intended for the sole use of the individual or entity to which it is addressed. If you are not the intended recipient, you must not review, retransmit, convert to hard-copy, copy, use or disseminate this email or any of its attachments. If you received this email in error, please notify the sender immediately and delete it. This notice is automatically appended to all Internet email. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]