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