[lug] parsing between two lists

Tkil tkil at scrye.com
Thu Mar 28 14:38:47 MST 2002


>>>>> "Rob" == Rob Nagler <nagler at bivio.biz> writes:

Rob> I'm sure there are more clever ways to do this.  

most of this stuff is covered in the Perl FAQs, under the name "set
operations" (since that's what we're doing -- union, difference,
intersection, etc).  perlfaq4 would be my guess...  yup:

   http://www.perldoc.com/perl5.6.1/pod/perlfaq4.html#How-do-I-compute-the-difference-of-two-arrays---How-do-I-compute-the-intersection-of-two-arrays-

Rob> Personally I appreciated the pipeline approach.  I'm just kind of
Rob> a Perl guy and use it in place of pipelines for a variety of
Rob> reasons.

doing things in perl has the advantage of consistent numbering (if god
meant arrays to start from one, he wouldn't have given us zeros), and
consistent quoting.  when you're just pumping data, though, it can be
helpful to use the small sharp pointy tools that unix gives us.

t.



More information about the LUG mailing list