Why can't I do something like this? Load everything to a buffer then cycle
through the buffer?
Thanks,
tim
#!/usr/bin/perl -w
open(MYFILE,'test2.txt');
while (<MYFILE>) {
$buffer .= $_;
}
$lnum = 1;
while ($buffer) {
chomp;
next if /^\*+/ or /^\s*$/;
my ($field, $value) = split /\s*:\s+/;
$field =~ s/^\s+//; # remove leading spaces from $field
$value =~ s/\s+$//; # remove trailing spaces from $value
print qq{$lnum: "$field","$value"\n};
$lnum++;
};
____________________________________________________
Timothy B Booher, Lt USAF, AFRL/MNAC
101 West Eglin Blvd, Suite 339
Eglin AFB FL 32542-6810
Phone: 850-882-8302 Ext. 3360 (DSN 872-)
FAX: 850-882-2201