Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Perl >> Snippet

read a text file one line at a time


open (SOURCE, "file.txt" );
while $line (SOURCE)
   {
  ( $a , $b , $c ) = split (/::/ $line )    # read 3 variables form a line in the file
   }
close (SOURCE)