I often end up processing files of arbitrary data in a variety of formats to extract some part or parts that is useful. Usually these snippets are just a little too long to write as one liners, but not long enough that I want them to live in their own file. Given that they are usually tailored to a specific file of data, (which i usually need to keep, perhaps for reprocessing) my preference is to actually turn these files into a little script by using the __DATA__ tag, as Im sure many of you out there do as well. eg
Now what I wish is that there was some switch like -n that worked the same way, but instead of pulling from STDIN (or filenames passed 1 at a time) it pulled from __DATA__#mindnumbingly simple example.... while (<DATA>) { my ($x,$y,$z)=split(/,/,4); #do something weird with $x,$y,$z } __DATA__ blah,blah,blah
Sigh. Well, thats one item for my perl christmas wish list...
:-)
Yves / DeMerphq
--
This space for rent.
In reply to A little Christmas switch wish.. by demerphq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |