Perl question

Victor Odhner plug-devel@lists.PLUG.phoenix.az.us
Sat Jun 2 15:12:01 2001


Rusty Carruth wrote:
>  # surely there's a better way to read a single line than the below,
>  # (sure I'll find out sometime ;-)
>  while(<TZFILE>)
>  {
>      $tz = $_;
>  }

What you did would work unless someone setup the TZ file with an empty line after the good one.

To read only the first (or next) line of a file, just do:
    $tz = <TZFILE>;

I'm sure this will appear as just one of a cluster of identical (and not very necessary) replies.  Oh well, don't you love e-mail lists?  ;-)

Vic