[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

vocabulary lister



 
    
Terrence,

It is program to randomly print vocabulary of GRE glossary.

Ting

#!/usr/bin/perl

$GRE_DIC=$ENV{'GRE_DIC'};
$char_num=147685;

open(GRE_DIC,$GRE_DIC);
label: 
while (1) {
  srand;
  $num=int (rand $char_num);
  seek (GRE_DIC, $num, 0);
  do{
    $c=getc GRE_DIC;
  }until ($c eq "\n" || eof GRE_DIC);
  if (eof GRE_DIC){seek (GRE_DIC, 0, 0);}
  while (<GRE_DIC>) {
    print; 
    system("sleep 1s");
    next label;
  }
}

Google