Re: Getting the first line from a file

2002-11-11 Thread Alan Dickey
Philip Morley wrote: > > Is there a better way of getting the first line from a file than this, if > so how: > > open (FILE, "somefile.txt"); > my $Counter = 1; > while () > { > chomp; > if ($Counter == 1) > { > $Line1 = $_; > } &

RE: Getting the first line from a file

2002-11-11 Thread Ishay Inbar
TECTED] Cc: Philip Morley Subject: RE: Getting the first line from a file open (FILE, "somefile.txt"); while () { chomp; $Line1 = $_; last; } close (FILE); -Original Message- From: Philip Morley [mailto:PMorley@;edisonmission.com] Sent: Monday, November 11, 2002 7:35 AM

RE: Getting the first line from a file

2002-11-11 Thread Jones Robert Contr TTMS Keesler
open (FILE, "somefile.txt"); while () { chomp; $Line1 = $_; last; } close (FILE); -Original Message- From: Philip Morley [mailto:PMorley@;edisonmission.com] Sent: Monday, November 11, 2002 7:35 AM To: [EMAIL PROTECTED] Subject: Getting the first line from a file

Getting the first line from a file

2002-11-11 Thread Philip Morley
Is there a better way of getting the first line from a file than this, if so how: open (FILE, "somefile.txt"); my $Counter = 1; while () { chomp; if ($Counter == 1) { $Line1 = $_; } $Counter++; } This method will read the entire file, which is unnecessary since I onl