Hi owen,

Please find the test.txt in theattachments.

Thanks and regards,
Gowri

-----Original Message-----
From: Owen [mailto:rc...@pcug.org.au] 
Sent: Wednesday, April 15, 2009 2:19 PM
To: Gowri Chandra Sekhar Barla, TLS, Chennai
Cc: Perl Beginners
Subject: RE: Reg:Regular expression


>
> Hi owen,
>
> Please help me in resolving errors in the following script
>
> open(INPUT,"<Test.txt");
> open(OUTPUT,">new.txt");
> $temp = \/user\/gowri\/remote2;
> while ( <INPUT> ) {
> $_ =~ s{\\/user\\/cce\\/g_tool}{$temp};
> print OUTPUT $_;
> }




Well, I can try.

But why don't you help me by sending a few lines of your Test.txt

There are a few things you might want to try first;

 a. place immediately under the #!/usr/bin/perl line

     use strict;
     use warnings;

 b. Change
     $temp = \/user\/gowri\/remote2; to
     my $temp = "\/user\/gowri\/remote2";

 (Note the inverted commas around the variable)

Now have another go
-- 



Owen



DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in 
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of 
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have 
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and 
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------
\/user\/cce\/g_tool
\/user\/cce\/g_tool
\/user\/cce\/g_tool
\/user\/cce\/g_tool
\/user\/cce\/g_tool
\/user\/cce\/g_tool
\/user\/cce\/g_tool 
-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/

Reply via email to