|
Prev: FAQ 4.44 How do I test whether two arrays or hashes are equal?
Next: FAQ 5.3 How do I count the number of lines in a file?
From: Charlton Wilbur on 24 Apr 2008 08:13 >>>>> "ASU" == A Sinan Unur <1usa(a)llenroc.ude.invalid> writes: ASU> I find this constant changing of posting ids pretty ASU> annoying. Please decide if you are Wade Ward or zaxfux or ASU> whatever it is and stick with it. In any case, you have been ASU> re-added to my killfile under this new identity and I cannot ASU> believe I have been fooled into responding to your question. Pay attention to the posting style - it's consistent. (I suspect his inability to write or program coherently and his inability to stick to the same posting ID are both symptoms of a deeper malaise.) Charlton -- Charlton Wilbur cwilbur(a)chromatico.net
From: Gerry Ford on 24 Apr 2008 21:50
"Charlton Wilbur" <cwilbur(a)chromatico.net> wrote in message news:8663u7h2m6.fsf(a)mithril.chromatico.net... >>>>>> "ASU" == A Sinan Unur <1usa(a)llenroc.ude.invalid> writes: > > ASU> I find this constant changing of posting ids pretty > ASU> annoying. Please decide if you are Wade Ward or zaxfux or > ASU> whatever it is and stick with it. In any case, you have been > ASU> re-added to my killfile under this new identity and I cannot > ASU> believe I have been fooled into responding to your question. > > Pay attention to the posting style - it's consistent. > > (I suspect his inability to write or program coherently and his > inability to stick to the same posting ID are both symptoms of a > deeper malaise.) #!/usr/bin/perl use strict; use warnings; my $killrc = "sample.killrc"; my @filter; sub read_killrc { return unless open(my $file, "<$killrc") ; return map { /^([^#]+)#?$/ && eval{ qr/$1/} || prompt $@, () } <$file> ; } print read_killrc; while (<DATA>) { chomp; next unless length; next if /^#/o; my $pat; eval '$pat = qr($_)' or do { warn $@; next }; push @filter, $pat; } print "$_\n" foreach @filter; __DATA__ ^From:.*cbfalconer Sinan ^Subject:.*memset ^Message-ID:.*googlegroups \w+).+? \s+(( __END__ # perl mats8.pl 2>text50.txt >text51.txt In this thread, I compared and contrasted the use of the map function as opposed to foreach, providing working Perl as an end-product. Furthermore, I stumbled on a way to test regex's. What did you do? You replied to a person who was wrong--Wade is my google identity, which I'd only use if I were traveling--and I've been home for the entire month, and reinforced the chippiness in usenet. What do your posts say about the topic at hand? -- "Life in Lubbock, Texas, taught me two things: One is that God loves you and you're going to burn in hell. The other is that sex is the most awful, filthy thing on earth and you should save it for someone you love." ~~ Butch Hancock |