Help for this page

Select Code to Download


  1. or download this
    #usage: ./getfone.pl output 
    use strict;
    ...
    open(NL, "namelist.txt) || die $!;
    open(PB, "phonebook.txt") || die $!;
    open(OUT,">$ARGV[0].txt") || die $!;
    
  2. or download this
    while(1) {
    
  3. or download this
      my @phonelisting = <PB>;
      chomp(@phonelisting);  
      my @name = <NL>;
      chomp(@name);
    
  4. or download this
      my @phonesearch = grep @name, @phonelisting;
    
  5. or download this
    print OUT "@phonesearch\n";
    last if eof;
    
  6. or download this
    close (NL);
    close (PB);
    close (OUT)