Path: utzoo!attcan!uunet!decwrl!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Reading a line in perl Message-ID: <9648@jpl-devvax.JPL.NASA.GOV> Date: 25 Sep 90 17:44:45 GMT References: <903@iiasa.UUCP> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 27 In article <903@iiasa.UUCP> wnp@iiasa.UUCP (wolf paul) writes: : What I want to do is this: : : while ($line1 = ) : { : $line2 = getline INFILE ; : . : . : . : } : : but I cannot find a "getline" function. Is there a way, short of : writing my own getline function using getc? Just say while ($line1 = ) { $line2 = ; . . . } The notation IS the getline function in Perl. Depending on how you want to handle $line2 not existing, you might want to say something like while ($line1 = || warn("Out of sync") && last; ... Larry