When you use " and also have \ then Perl will take \ as indicating to take the
next character as is. So the code
open(INPUT, "..\SampleConfig.xml");
becomes in the processing
"..SampleConfig.xml" which is not what you want.
Either add an extra \ so you have \\ or you can use single ' which will take
as is or use / in place of \.
Wags ;)
-----Original Message-----
From: K.Srinivas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 24, 2002 00:11
To: [EMAIL PROTECTED]
Subject: file handle not working in NT
Hi,
I have a piece of code in which I have to use some filehandles:
if( $^O eq "MSWin32"){
open(INPUT, "..\SampleConfig.xml");
}
else {
open(INPUT, "SampleConfig.xml");
}
open(OUTPUT, ">LoaderConfig.xml");
while(<INPUT>)
{print "Hi hello\n";
if ($_ =~ /<UserName>/){print OUTPUT " <UserName>$db_user</UserName>\n";
}
The problem I am facing in Nt machine with the script is that it does not
take relative paths in the input file handle. ANy suggestions as to why this
is so whereare in UNIX relative apths are getting accepted.
K.Srinivas
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
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]