in reply to Opening a file, editing, copying to another
That line does nothing. If you want to write to your file you would do$commentout = $commentout .= $position; s/$position/$commentout/; print OTHER; #THIS LINE HERE!! $x++;
another thing that should be pointed outprint OTHER "I am printing foo to file\n";
This does nothing. Are you trying to do a regular expresion with that? If so you need to go back and read up on the Perl regular expressions. It should have the forms/$position/$commentout/
I hope that helps$variable =~ s/<regular-expression>/<substitution-here>/; #For example the following my $variable = "Blue Car"; print $variable."\n"; $variable =~ s/Blue/Red/; print $variable."\n";
<code>tags.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Opening a file, editing, copying to another
by GrandFather (Saint) on Jun 20, 2007 at 23:30 UTC | |
by toolic (Bishop) on Jun 20, 2007 at 23:37 UTC | |
by GrandFather (Saint) on Jun 20, 2007 at 23:44 UTC | |
by Grundle (Scribe) on Jun 21, 2007 at 13:57 UTC | |
by GrandFather (Saint) on Jun 21, 2007 at 14:25 UTC |