<?xml version="1.0" encoding="windows-1252"?>
<node id="282966" title="Updating a text file" created="2003-08-11 14:10:20" updated="2004-08-22 13:58:06">
<type id="115">
perlquestion</type>
<author id="190142">
kirk123</author>
<data>
<field name="doctext">
&lt;p&gt;
Hi
&lt;br /&gt;
  I am trying to update a text file.  The error I am getting is:
&lt;code&gt;
Can't "next" outside a block at PersonalfrmList.pl line 59
&lt;/code&gt;
Here a snippet of my code:
&lt;code&gt;
open(IN,"c:\\h\CSSCS\\bin\\scripts\\ListofFile.txt") || die "Can't open ListofFile.txt:$!\n";

@lines = &lt;IN&gt;;
close IN;

my $change_count = 0;
@lines = map{$change_count ++ if s/ORGANIZT-3FC930/CSSCS/sgi;$_ } @lines;
next unless $change_count;

open(OUT,"&gt;c:\\h\\CSSCS\\bin\\scripts\\ListofFile.txt")|| "Can't open file for writing:$!\n";

print OUT @lines;
close OUT;
&lt;/code&gt;&lt;p&gt;
Can someone tell me what is wrong with my script?&lt;br /&gt;


---kirk
&lt;/p&gt;
&lt;p&gt;&lt;small&gt;20030811 Edit by [Corion]: Added formatting&lt;/small&gt;&lt;/p&gt;</field>
</data>
</node>
