Help for this page

Select Code to Download


  1. or download this
    while (my $record = <EMPLOYEES>) {
      chomp $record;
      my @person = split /\t/, $record;
      # now do something interesting with @person
    }
    
  2. or download this
    my @cols = qw(name email office);
    while (my $record = <EMPLOYEES>) {
    ...
      @person{@cols} = split /\t/, $record;
      # now do something interesting with %person
    }
    
  3. or download this
    open (EMPLOYEES, 'employees.txt')
      or die "Can't open employees.txt: $!\n";