Re: Substitution operator is not working in perl - Windows OS

2014-12-05 Thread Jitendra Barik
Hi Adam, Yes File is RTF. Regards, Jitendra On Fri, Dec 5, 2014 at 7:57 PM, Adam Millerchip wrote: > Your filename is in a variable called $rtf1, is the file an RTF? > > Maybe something funny is going on with the file-format/encoding, and the > first line doesn't contain %VERSION% when parsed

Re: Substitution operator is not working in perl - Windows OS

2014-12-05 Thread Adam Millerchip
Your filename is in a variable called $rtf1, is the file an RTF? Maybe something funny is going on with the file-format/encoding, and the first line doesn't contain %VERSION% when parsed by your script. You could try printing out the line in your script to see what it's trying to match: for(@arra

Re: Substitution operator is not working in perl - Windows OS

2014-12-04 Thread Jitendra Barik
Hi Shawn, it is VERSION. This is the not a issue. s/\%VERSION\%/$version1/g; the correct one. If I changed VERSION to VERSIONABC it is working correctly OR if I add more character to VERSION then it is working. I could not understand why it is not working for me. The first place in the file is n

Re: Substitution operator is not working in perl - Windows OS

2014-12-04 Thread Shawn H Corey
On Thu, 4 Dec 2014 16:06:26 +0530 Jitendra Barik wrote: > My code is: > > $version1 = "JITENDRA"; > tie @array,Tie::File,"$rtf1" or die($!); > > for(@array){ > #print "Hi"; > s/\%VERSIONS\%/$version1/g; > > > } > untie(@array); > > FILE: > ***

Re: Substitution operator is not working in perl - Windows OS

2014-12-04 Thread Hans Ginzel
Hello, I am sorry, I don't know what are you doing wrong, but this code works for me. use strict; #use warnings; use Tie::File; my $file = 'file.txt'; my $version1 = "JITENDRA"; tie my(@array), 'Tie::File', $file or die "Cannot open file `$file': $!"; for(@array) { #warn "F: ", $_; s/%VER

Substitution operator is not working in perl - Windows OS

2014-12-04 Thread Jitendra Barik
HI All, My code is: $version1 = "JITENDRA"; tie @array,Tie::File,"$rtf1" or die($!); for(@array){ #print "Hi"; s/\%VERSIONS\%/$version1/g; } untie(@array); FILE: *** *Version *%VERSION%, Hello,HI *Installation Notes* T