use Readonly; Readonly my $FIELD_LAYOUT => 'A10 A20 A10'; # 10 ASCII characters, 20 +ASCII characters, 10 ASCII characters; foreach my $line (@file) { my ($program, $junk, $date) = unpack $FIELD_LAYOUT, $line; print "Program: $program\n"; print "Date: $date\n"; }
I found this code layout a bit easier to understand but it is still basically the same as what japhy Re: Split a Line posted.
In reply to Re: Split a Line
by Herkum
in thread Split a Line
by curtisb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |