I see that :) but not sure how to pull just the first line from the file
WITHOUT closing it and skipping to the next...


local @ARGV = @sleepystart;
while (<>) {
        $line = $_; # ??????
        s/\Q$line\E/$db_name/g;
        print;
}

> -----Original Message-----
> From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 09, 2002 12:07
> To: Yacketta, Ronald
> Cc: Beginners (E-mail)
> Subject: RE: array of filenames to open
> 
> 
> On Jan 9, Yacketta, Ronald said:
> 
> >is their another trick to forgo the 4 lines above the "local 
> @ARGV" ??
> 
> The ARGV trick is meant to AVOID the for loop.
> 
> >                        foreach $file (@sleepystart) {
> >                                open FILE, "$file";
> >                                $line = <FILE>;
> >                                close (FILE);
> >                                chomp($line);
> >                                local @ARGV = @sleepystart;
> >                                while (<>) {
> >                                        s/\Q$line\E/$db_name/g;
> >                                        print;
> >                                }
> >                        }
> 
> To loop over the files, just do:
> 
>   {
>     local @ARGV = @sleepystart;
>     while (<>) {
>       # ...
>     }
>   }
> 
> -- 
> Jeff "japhy" Pinyan      [EMAIL PROTECTED]      
> http://www.pobox.com/~japhy/
> RPI Acacia brother #734   http://www.perlmonks.org/   
http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to