in reply to Re: Re: Re: Re: Re: Re: Re: Non-fixed data in record
in thread Non-fixed data in record
You are reading the file in one line at a time, not one block at a time. Don't make things complicated.open IN_FILE, "<my_in_file" or die "Cannot open my_in_file\n"; LINE: whle (<IN_FILE) { # This is a big block if (/^\S/) { } elsif (/^\s{2}\S/) { # Do what you want to do for middle hash } elsif (/^\s{4}\S/) { # Do what you want to do for inner hash } else { die "Bad line in datafile\n"; } } close IN_FILE;
K-I-S-S
------
We are the carpenters and bricklayers of the Information Age.
Vote paco for President!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Keep It Simple, S*****
by brassmon_k (Sexton) on Aug 31, 2001 at 23:26 UTC |