Perl Programming | ||
---|---|---|
Writing to Files | ||
open CUSTOMERS, "< mailing_list" or die "Can't open input file: $!"; open LABELS, "> labels" or die "Can't open output file: $!"; while (my $line = <CUSTOMERS>) { my @fields = split(":", $line); print LABELS "$fields[1] $fields[0]\n"; print LABELS "$fields[3], $fields[4]\n"; print LABELS "$fields[5], $fields[6] $fields[7]\n"; } |
||
Previous | http://stuff.mit.edu/iap/perl/ | Next |