From Todd.Cranston-Cuebas at Ticketmaster.com Mon Sep 11 11:14:13 2006 From: Todd.Cranston-Cuebas at Ticketmaster.com (Todd Cranston-Cuebas) Date: Mon, 11 Sep 2006 11:14:13 -0700 Subject: [LA.pm] Please email "thank you" to Luke Kanies from Ruby Talk Message-ID: <71D28C8451BFD5119B2B00508BE26E640D4038F0@pasmail3.office.tmcs> If you came to the last TechTalk, and liked Luke's presentation, I'd really appreciate it if you would drop him a _quick_ email and send your thanks (luke at reductivelabs.com). Like I said before, Luke was in town for a wedding and took time away from the festivities to come over and give us his excellent presentation (along with his wife, and 2 friends). His presentation was both funny and highly informative. Let's send a quick "thank you." I'm sure he'd appreciate it. Todd From Todd.Cranston-Cuebas at Ticketmaster.com Thu Sep 28 10:54:44 2006 From: Todd.Cranston-Cuebas at Ticketmaster.com (Todd Cranston-Cuebas) Date: Thu, 28 Sep 2006 10:54:44 -0700 Subject: [LA.pm] Please email "thank you" to Luke Kanies from Ruby Tal k Message-ID: <71D28C8451BFD5119B2B00508BE26E640D403B1F@pasmail3.office.tmcs> Sorry guys. His laptop crashed out and it's being restored or something. I should have the slides as soon as his machine is restored. I know you're bummed but imagine how he's feeling ;) Todd > -----Original Message----- > From: Chris [mailto:smawhoo at yahoo.com] > Sent: Thursday, September 21, 2006 2:33 PM > To: Todd Cranston-Cuebas > Subject: Re: [LA.pm] Please email "thank you" to Luke Kanies > from Ruby Talk > > Todd, > > I think you promised to share some slides with us regarding > why people need > > use Ruby, learn Ruby. > > (In particular for Perl folks) > > Many thanks:) > > --- Todd Cranston-Cuebas > wrote: > > > If you came to the last TechTalk, and liked Luke's > presentation, I'd > > really appreciate it if you would drop him a _quick_ email and send > > your thanks (luke at reductivelabs.com). > > > > Like I said before, Luke was in town for a wedding and took > time away > > from the festivities to come over and give us his excellent > > presentation (along with his wife, and 2 friends). His presentation > > was both funny and highly informative. Let's send a quick > "thank you." > > I'm sure he'd appreciate it. > > > > Todd > > _______________________________________________ > > Losangeles-pm mailing list > > Losangeles-pm at pm.org > > http://mail.pm.org/mailman/listinfo/losangeles-pm > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection > around http://mail.yahoo.com > From lapm at veggiechinese.net Thu Sep 28 11:19:12 2006 From: lapm at veggiechinese.net (William Yardley) Date: Thu, 28 Sep 2006 11:19:12 -0700 Subject: [LA.pm] split() question Message-ID: <20060928181912.GA14993@mitch.veggiechinese.net> I'm doing some maintenance on a CPAN module I didn't write (Mail::DeliveryStatus::BounceParser), and (around line 356 if anyone needs to actually look there), we do something like: foreach my $para (split /\n{2,}/, $delivery_status_body) { my $report = Mail::Header->new([split /\n/, $para]); What's strange, is that in some cases, there is a leading \n left, which results in $report not having the stuff we expect there. I'd assume that since the \n{2,} should be greedy, there wouldn't be any \ns left after that split. However, if I print out $para inside the loop, I see a leading \n. Simply doing a: $para =~ s/\A\n+//g; in between those two lines "fixes" the problem - but I was wondering if anyone know why this is happening. w From ben_tilly at operamail.com Thu Sep 28 16:33:08 2006 From: ben_tilly at operamail.com (Benjamin J. Tilly) Date: Fri, 29 Sep 2006 07:33:08 +0800 Subject: [LA.pm] split() question Message-ID: <20060928233308.D78763AA560@ws5-8.us4.outblaze.com> "William Yardley" wrote: > > I'm doing some maintenance on a CPAN module I didn't write > (Mail::DeliveryStatus::BounceParser), and (around line 356 if anyone > needs to actually look there), we do something like: > > foreach my $para (split /\n{2,}/, $delivery_status_body) { > my $report = Mail::Header->new([split /\n/, $para]); > > What's strange, is that in some cases, there is a leading \n left, which > results in $report not having the stuff we expect there. I'd assume that > since the \n{2,} should be greedy, there wouldn't be any \ns left after > that split. However, if I print out $para inside the loop, I see a > leading \n. Is it possible that your data looks like "\nstuff\n\n\nmore stuff"? Then the first string has a \n at the start that the split is not going to catch. But if the \n is starting on the second string, then that is a bug. I would create a minimal test example and report it. Then workaround the bug in any way you can. > Simply doing a: > $para =~ s/\A\n+//g; > in between those two lines "fixes" the problem - but I was wondering if > anyone know why this is happening. You have my top two guesses in order. First, $delivery_status_body sometimes starts with \n, and failing that that there is Perl bug. The third most likely possibility is that you have a Heisenbug, which you'd notice by your inability to produce a minimal test case. I have no useful suggestions for what to do then. Cheers, Ben From lapm at veggiechinese.net Thu Sep 28 17:10:09 2006 From: lapm at veggiechinese.net (William Yardley) Date: Thu, 28 Sep 2006 17:10:09 -0700 Subject: [LA.pm] split() question In-Reply-To: <20060928233308.D78763AA560@ws5-8.us4.outblaze.com> References: <20060928233308.D78763AA560@ws5-8.us4.outblaze.com> Message-ID: <20060929001009.GJ14993@mitch.veggiechinese.net> On Fri, Sep 29, 2006 at 07:33:08AM +0800, Benjamin J. Tilly wrote: > "William Yardley" wrote: > > I'm doing some maintenance on a CPAN module I didn't write > > (Mail::DeliveryStatus::BounceParser), and (around line 356 if anyone > > needs to actually look there), we do something like: > > foreach my $para (split /\n{2,}/, $delivery_status_body) { > > my $report = Mail::Header->new([split /\n/, $para]); > > > > What's strange, is that in some cases, there is a leading \n left, which > > results in $report not having the stuff we expect there. I'd assume that > > since the \n{2,} should be greedy, there wouldn't be any \ns left after > > that split. However, if I print out $para inside the loop, I see a > > leading \n. > Is it possible that your data looks like "\nstuff\n\n\nmore stuff"? > Then the first string has a \n at the start that the split is not > going to catch. Right. I thought it was two - original message - http://emailproject.perl.org/svn/Mail-DeliveryStatus-BounceParser/trunk/t/corpus/surfcontrol-extra-newline.msg - has two, but looks like it is one by the time I get to it, which (basically) explains the problem. --start-- Action: failed Final-Recipient: rfc822;recipient at example.com Diagnostic-Code: smtp; 554 Service currently unavailable Status: 5.0.0 --end-- > You have my top two guesses in order. First, $delivery_status_body > sometimes starts with \n, and failing that that there is Perl bug. Right - the problematic example started with a single blank line. I was thinking it was two (since there are two \ns in the original message) and / or that a blank line followed by text would be two \ns total. I guess I could do: split /(\n{2,}|\A\n)/, $delivery_status_body but probably the other workaround is better. w