Help for this page

Select Code to Download


  1. or download this
    open(FILE, "data.txt");          #opens data.txt in read-mode
    while(<FILE>){         #reads line by line from FILE w +hich is the fi
    +lehandle for data.txt
    ...
       print "Saw $_ in data.txt\n"; #shows you what we have read
    }
    close FILE;                      #close the file.
    
  2. or download this
    open (FILE, "users");
    while (<FILE>) {
    chomp;
    ($name, $value) = split(/,/, $_);