in reply to Re: RFC:Hacking Tie::File to read complex data
in thread RFC:Hacking Tie::File to read complex data
Hi ff. First of all thanks a lot for the feedback! (It is not easy to read and go deep in such long posts) :-)
In my root post I gave a dummy example of input and output to show the concept of the interface solution. Clearly, there is no need to hack a complex module to parse the example data. (In the same way that you don't need to use Tie::File to simply read data from a file and output it to STDOUT).
But lets try another example a bit more interesting where the tied interface could give a very simple solution: Suppose that I want to get a random record. With the interface solution you can do it even with a simple perl one-liner!:
perl -e 'use Tie::File::GFF; tie my @arr,'Tie::File::GFF',"infile"; pr +int $arr[int rand ($#arr)];'
Try to do it "native" and lets compare the number of lines needed!
Thanks again for your feedback!!
Cheers
citromatik
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: RFC:Hacking Tie::File to read complex data
by ff (Hermit) on Jun 15, 2007 at 12:33 UTC | |
by citromatik (Curate) on Jun 15, 2007 at 13:16 UTC |