>>>>> "A" == A4r0N <mccray...@gmail.com> writes:
A> I need to add "new lines" of text with special characters, to specific A> lines in the file. There are 3 modifications needed. Been testing 2 A> here without success. A> #!/usr/bin/perl A> use FileHandle; that module is unneeded for such simple use. and FileHandle is obsolete anyhow. just open the file with a normal or lexical handle. see perldoc -f open A> $file=FileHandle->new; A> $FILENAME="/opt/etc/usr/file.txt"; put some whitespace in your code to make it more readable A> $file->open ("<$FILENAME") or die ("Error: $!\n"); good, you checked the return of open and printed $! A> while (<$file>) { A> $count++; A> if ($count=39) { as someone else pointed out, that should be ==. but look at $. in perldoc perlvar for a simpler way to do this. A> print qq[RM="rm2"];} A> if ($count=47) { A> print qq[$RM] A> } as with the above, learn to format your code better. that should all be indented properly to help with reading it. and you never print the line you read from the file itself. that is in $_. uri -- Uri Guttman ------ u...@stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/