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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A little Christmas switch wish..
by chromatic (Archbishop) on Dec 12, 2001 at 01:46 UTC | |
by demerphq (Chancellor) on Dec 12, 2001 at 17:59 UTC | |
|
Re: A little Christmas switch wish..
by dragonchild (Archbishop) on Dec 12, 2001 at 01:13 UTC | |
by demerphq (Chancellor) on Dec 12, 2001 at 01:38 UTC | |
by dragonchild (Archbishop) on Dec 12, 2001 at 01:46 UTC | |
by demerphq (Chancellor) on Dec 12, 2001 at 23:56 UTC | |
|
Re: A little Christmas switch wish..
by chromatic (Archbishop) on Dec 13, 2001 at 03:42 UTC |