From glim at mycybernet.net Tue May 10 20:09:00 2005 From: glim at mycybernet.net (Gerard Lim) Date: Tue, 10 May 2005 23:09 -0400 Subject: [CMI.PM] Yet Another Perl Conference final details Message-ID: Hi everyone... There have been some recent developments on the YAPC::NA front, and it has been suggested to us that a reminder might be helpful to some people, so here's a quick summary of the event. Summary ------- YAPC::NA 2005 (Yet Another Perl Conference, North America) in Toronto, Canada, Monday - Wednesday 27 - 29, June 2005 Home page: http://yapc.org/America/ Conference Location: http://89chestnut.com/ A facility of the University of Toronto Accommodations -------------- Normally registration information would come first, but accommodations are the bottleneck -- our main group reservation (at the conference hotel) expires at the end of the week, and as the conference approaches it will be extremely difficult to find a hotel anywhere in the city. Info on how to book at: http://yapc.org/America/accommodations-2005.shtml Registration ------------ Register now! :-) We are on track to break attendance records at YAPC::NA this year, and we could even sell out before the conference starts. The price for the full 3 days is USD$85. We keep it insanely low through many generous sponsorships and the all-volunteer organizational and speaking crews. Registration info: http://yapc.org/America/register-2005.shtml Direct registration link: http://donate.perlfoundation.org/index.pl?node=registrant%20info&conference_id=423 Conference Speaking Schedule ---------------------------- We've got an excellent selection of talks and speakers for Perl programmers of all levels, beginner through expert. We are fortunate enough to have presentations coming from some of the most recognizable names in Perl programming today, including Larry Wall, Chip Salzenberg, Dan Sugalski, Autrijus Tang and brian d foy. Summary -- http://yapc.org/America/schedule-2005/summary.html Day 1 -- http://yapc.org/America/schedule-2005/day1.html Day 2 -- http://yapc.org/America/schedule-2005/day2.html Day 3 -- http://yapc.org/America/schedule-2005/day3.html Lightning Talks --------------- These short (5 minutes each) talks, presented by the conference attendees, are a YAPC tradition. If you're interested please read more about them and sign up: http://www.justanotherperlhacker.org/lightning/ [ This message was sent by Gerard Lim on behalf of the YAPC::NA 2005 Conference organizing committee of the Toronto Perl Mongers. Thanks for your patience and support. ] From mitch at ncsa.uiuc.edu Wed May 25 14:14:47 2005 From: mitch at ncsa.uiuc.edu (Mitch Kutzko) Date: Wed, 25 May 2005 16:14:47 -0500 Subject: [CMI.PM] String matching sanity check? Message-ID: <3.0.5.32.20050525161447.0191f3c0@pop.ncsa.uiuc.edu> Hi, folks -- I'm trying to do some substitutions on some email archive files, and convert the "@" in any email addresses found in the Subject: line to " --at-- ". I'm trying this just to test with right now: #!/usr/bin/perl -pi.old s/Subject: \(.*\)@\(.*\)/Subject: \1 --at-- \2/g; But this steadfastly refuses to match anything. Here's a typical line it would encounter: Subject: DAST: Iperf - Iperf win32 Binaries - mervyn.yeo at gmail.com Doesn't matter if I escape the "@". This also doesn't match: s/Subject: \(.*\)\@\(.*\)/Subject: \1 --at-- \2/g; This has to be some simple thing I'm forgetting, but right now it's completely eluding me. Any ideas? Thanks, Mitch -- Mitch Kutzko | mitch at dast.nlanr.net | mitch at ncsa.uiuc.edu | 217-333-1199 Project: http://dast.nlanr.net/ | Personal: http://hobbes.ncsa.uiuc.edu/ From jak at uiuc.edu Wed May 25 14:19:54 2005 From: jak at uiuc.edu (Jay A. Kreibich) Date: Wed, 25 May 2005 16:19:54 -0500 Subject: [CMI.PM] String matching sanity check? In-Reply-To: <3.0.5.32.20050525161447.0191f3c0@pop.ncsa.uiuc.edu> References: <3.0.5.32.20050525161447.0191f3c0@pop.ncsa.uiuc.edu> Message-ID: <20050525211954.GA14430@uiuc.edu> On Wed, May 25, 2005 at 04:14:47PM -0500, Mitch Kutzko scratched on the wall: > Hi, folks -- I'm trying to do some substitutions on some email archive > files, and convert the "@" in any email addresses found in the Subject: > line to " --at-- ". > > I'm trying this just to test with right now: > > #!/usr/bin/perl -pi.old > s/Subject: \(.*\)@\(.*\)/Subject: \1 --at-- \2/g; You're escaping the ()'s, so it is looking for literal ()s. If you want to group things for the replacement, don't escape the ()s. -j -- Jay A. Kreibich | CommTech, Emrg Net Tech Svcs jak at uiuc.edu | Campus IT & Edu Svcs | University of Illinois at U/C From mitch at ncsa.uiuc.edu Wed May 25 14:32:43 2005 From: mitch at ncsa.uiuc.edu (Mitch Kutzko) Date: Wed, 25 May 2005 16:32:43 -0500 Subject: [CMI.PM] String matching sanity check? In-Reply-To: <1117055917.DCD7921@be12.dngr.org> References: <3.0.5.32.20050525161447.0191f3c0@pop.ncsa.uiuc.edu> <3.0.5.32.20050525161447.0191f3c0@pop.ncsa.uiuc.edu> Message-ID: <3.0.5.32.20050525163243.0191f3c0@pop.ncsa.uiuc.edu> Doh. vi's "ed" bites me once again. :-) After un-escaping the parens, it works wonderfully! Thanks, Mitch At 04:18 PM 5/25/2005 -0500, you wrote: > Take out the backslashes before the parentheses -- it's not necessary as > the parentheses are already special grouping characters. > > Cheers, > Arun > > On Wed, 25 May 2005 4:15 pm, Mitch Kutzko wrote: > > Hi, folks -- I'm trying to do some substitutions on some email archive > > files, and convert the "@" in any email addresses found in the Subject: > > line to " --at-- ". > > > > I'm trying this just to test with right now: > > > > #!/usr/bin/perl -pi.old > > s/Subject: \(.*\)@\(.*\)/Subject: \1 --at-- \2/g; > > > > But this steadfastly refuses to match anything. Here's a typical line > > it > > would encounter: > > > > Subject: DAST: Iperf - Iperf win32 Binaries - mervyn.yeo at gmail.com > > > > Doesn't matter if I escape the "@". This also doesn't match: > > > > s/Subject: \(.*\)\@\(.*\)/Subject: \1 --at-- \2/g; > > > > > > This has to be some simple thing I'm forgetting, but right now it's > > completely eluding me. Any ideas? > > > > Thanks, > > > > Mitch > > -- > > Mitch Kutzko | mitch at dast.nlanr.net | mitch at ncsa.uiuc.edu | > > 217-333-1199 > > Project: http://dast.nlanr.net/ | Personal: > > http://hobbes.ncsa.uiuc.edu/ > > _______________________________________________ > > Champaign-Urbana mailing list > > Champaign-Urbana at pm.org > > http://mail.pm.org/mailman/listinfo/champaign-urbana > > -- Mitch Kutzko | mitch at dast.nlanr.net | mitch at ncsa.uiuc.edu | 217-333-1199 Project: http://dast.nlanr.net/ | Personal: http://hobbes.ncsa.uiuc.edu/ From mitch at ncsa.uiuc.edu Wed May 25 15:08:21 2005 From: mitch at ncsa.uiuc.edu (Mitch Kutzko) Date: Wed, 25 May 2005 17:08:21 -0500 Subject: [CMI.PM] String matching sanity check? Message-ID: <3.0.5.32.20050525170821.0191f3c0@pop.ncsa.uiuc.edu> >Take out the backslashes before the parentheses -- it's not necessary as >the parentheses are already special grouping characters. Now, I've discovered several continued lines. Any suggestions on how to handle things like this cleanly: Subject: DAST: Iperf - read failed: Connection refused - luca.seoli at aliceposta.it Mime-Version: 1.0 (I want to check for an email address anywhere between the Subject: line and the next "real" line, the Mime-Version: line.) Theoretically, this: #!/usr/bin/perl -p0777i.old s/Subject: (.*)@(.*)Mime-Version:/Subject: \1 --at-- \2Mime-Version:/s; or this: #!/usr/bin/perl -p0777i.old s/Subject: (.*)@(.*)Mime-Version:/Subject: \1 --at-- \2Mime-Version:/m; should work, right? But I'm clearly not understanding something correctly, because they don't work. The -p0777 says to look at the whole file, not just line-by-line, so why is this not matching? Thanks, Mitch -- Mitch Kutzko | mitch at dast.nlanr.net | mitch at ncsa.uiuc.edu | 217-333-1199 Project: http://dast.nlanr.net/ | Personal: http://hobbes.ncsa.uiuc.edu/ From lewart at uiuc.edu Wed May 25 16:01:37 2005 From: lewart at uiuc.edu (Daniel S. Lewart) Date: Wed, 25 May 2005 18:01:37 -0500 Subject: [CMI.PM] String matching sanity check? In-Reply-To: <3.0.5.32.20050525170821.0191f3c0@pop.ncsa.uiuc.edu> References: <3.0.5.32.20050525170821.0191f3c0@pop.ncsa.uiuc.edu> Message-ID: <429503D1.7040204@uiuc.edu> Mitch, > Now, I've discovered several continued lines. Any suggestions on how to > handle things like this cleanly: > Subject: DAST: Iperf - read failed: Connection refused - > luca.seoli at aliceposta.it > Mime-Version: 1.0 How do I parse a mail header?: http://perldoc.perl.org/perlfaq9.html#How-do-I-parse-a-mail-header%3f > (I want to check for an email address anywhere between the Subject: line > and the next "real" line, the Mime-Version: line.) > Theoretically, this: > #!/usr/bin/perl -p0777i.old > s/Subject: (.*)@(.*)Mime-Version:/Subject: \1 --at-- \2Mime-Version:/s; > or this: > #!/usr/bin/perl -p0777i.old > s/Subject: (.*)@(.*)Mime-Version:/Subject: \1 --at-- \2Mime-Version:/m; > should work, right? But I'm clearly not understanding something correctly, > because they don't work. Since they don't work in practice, they shouldn't work theoretically either. > The -p0777 says to look at the whole file, not just line-by-line, so why is > this not matching? For starters, I would change the first line to: #!/usr/bin/perl -W -0777 -p -i.old Then I would change \1 and \2 to $1 and $2, respectively. Perhaps you want /s instead of /m? Good luck! Dan