[EMAIL PROTECTED] wrote:
> 
> Hi:
> 
> Suppose I have a directory with files file1.txt, file2.txt, ..., filen.txt
> 
> Suppose the the 2nd line is always
> 
> INFILE 'xxxxxyyyyyyzzzzzz.dat'
> 
> where x y and z repeat differently in every file.  It is always the 2nd
> line in each file.
> 
> How do I replace yyyy with wwww?  TIA?

see perldoc -f eof 

and from perlop:
If either operand of scalar ".." is a
       constant expression, that operand is implicitly compared
       to the $. variable, the current line number.  Examples:


    while (<>) {
        if (2..2) { s/yyyy/wwww/ }
        print
    } continue {
        close ARGV  if eof;     # Not eof()!
    }


-- 
Ned Konz
currently: Stanwood, WA
email:     [EMAIL PROTECTED]
homepage:  http://www.bike-nomad.com

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to