From tony.edwardson at usa.net Tue Jun 8 13:08:07 2010 From: tony.edwardson at usa.net (Tony Edwardson) Date: Tue, 08 Jun 2010 21:08:07 +0100 Subject: Milton Keynes Perl Mongers Technical Meeting: Tuesday 15th June, 2010 Message-ID: <4C0EA327.4060603@usa.net> their next our fourth and final technical meeting Tuesday 15th Jone at the Open University's Systems Seminar Room. Arrive at 7pm so the first talk can start promptly at 7.15. This meeting is open to regular group members, newcomers and anyone else who would like to listen to the talks. If you can think of anyone who might like to come, please invite them. Benjamin Martin will give a lightning talk on the ASE (Android Scripting Enviroment) JJ will give An Introduction to CouchDB - what is CouchDB, why should you use it, and how do you access it from Perl Paul Mooney will talk about Catalyst::Engine::Stomp and MooseX::Workers And I will be talking about how I have made good use of what I have learnt at previous tech meets Finally, remember to arrive at the OU for 7pm on Tuesday 15th June. Here's how to find us: First, find the OU campus as described at http://www3.open.ac.uk/contact/locations.aspx Enter the campus (signposted Open University, not Open University East), via Brickhill Street (V10). Take the middle lane past Security (on the left), through the barriers, and then turn right on to Ring Road East. Ahead you will see the road narrows to single lane on your side of the road, where there are no entry signs. Just prior to this is the entrance to a car park on the left (marked Inner East Parking on the campus map). Take this left turn and head to the top left (North West on the campus map) of the car park. The meeting is in the south east section of the Venables Building, nearest the Inner East Parking on the campus map. Take the path (marked in orange on the campus map) west from the car park toward the centre of campus. Take a right under an archway in to the courtyard area bound by Venables South, East, and South East, keeping right (heading North East on the campus map), behind the building section marked South East. You will find a double door on your right, which is Entrance G at the South East section of Venables Building. We'll see you there, as these are usually access controlled doors, so you will probably need to be let in. If you haven't attended one of our meetings at the OU before, you might want to ask for someone's phone number in case you have trouble finding us. If you need a lift to the meeting, please ask our mailing list or IRC channel (see http://miltonkeynes.pm.org/ for details). See you on the 15th, Tony From tony.edwardson at usa.net Tue Jun 8 13:14:57 2010 From: tony.edwardson at usa.net (Tony Edwardson) Date: Tue, 08 Jun 2010 21:14:57 +0100 Subject: Milton Keynes Perl Mongers Technical Meeting: Tuesday 15th June, 2010 (resent) Message-ID: <4C0EA4C1.4060108@usa.net> Milton Keynes Perl Mongers will hold our next technical meeting on Tuesday 15th Jone at the Open University's Systems Seminar Room. Arrive at 7pm so the first talk can start promptly at 7.15. This meeting is open to regular group members, newcomers and anyone else who would like to listen to the talks. If you can think of anyone who might like to come, please invite them. Benjamin Martin will give a lightning talk on the ASE (Android Scripting Enviroment) JJ will give An Introduction to CouchDB - what is CouchDB, why should you use it, and how do you access it from Perl Paul Mooney will talk about Catalyst::Engine::Stomp and MooseX::Workers And I will be talking about how I have made good use of what I have learnt at previous tech meets Finally, remember to arrive at the OU for 7pm on Tuesday 15th June. Here's how to find us: First, find the OU campus as described at http://www3.open.ac.uk/contact/locations.aspx Enter the campus (signposted Open University, not Open University East), via Brickhill Street (V10). Take the middle lane past Security (on the left), through the barriers, and then turn right on to Ring Road East. Ahead you will see the road narrows to single lane on your side of the road, where there are no entry signs. Just prior to this is the entrance to a car park on the left (marked Inner East Parking on the campus map). Take this left turn and head to the top left (North West on the campus map) of the car park. The meeting is in the south east section of the Venables Building, nearest the Inner East Parking on the campus map. Take the path (marked in orange on the campus map) west from the car park toward the centre of campus. Take a right under an archway in to the courtyard area bound by Venables South, East, and South East, keeping right (heading North East on the campus map), behind the building section marked South East. You will find a double door on your right, which is Entrance G at the South East section of Venables Building. We'll see you there, as these are usually access controlled doors, so you will probably need to be let in. If you haven't attended one of our meetings at the OU before, you might want to ask for someone's phone number in case you have trouble finding us. If you need a lift to the meeting, please ask our mailing list or IRC channel (see http://miltonkeynes.pm.org/ for details). See you on the 15th, Tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom at eborcom.com Thu Jun 10 05:41:30 2010 From: tom at eborcom.com (Tom Hukins) Date: Thu, 10 Jun 2010 13:41:30 +0100 Subject: Regular Expression Annoyance Message-ID: <20100610124129.GN2208@eborcom.com> Hello, I'm writing a Test::WWW::Mechanize script to help me test the Web interface to one of the systems I babysit. I have something like the following: $mech->content_unlike( qr/Error: ([^>]+)/, 'No error message' ); diag $1 if $1; So, if my test script encounters an error, I get to see it. At least, that's the plan. But $1 never contains anything. Here's why: perl -E 'sub foo { $_[0] =~ /Hi (\w+)/; } foo("Hi Tom"); say "Hello $1";' $1 doesn't exist in the scope I diag() or say() in because the regular expression ran in a different scope. This makes sense: generally, I wouldn't want different scopes to interfere with each other. So I've written: $mech->content_unlike( qr/Error: ([^>]+)/, 'No error message' ) || $mech->content() =~ qr/Error: ([^>]+)/ && diag $1; But that feels horrid and long winded. I like writing succinct, expressive code. And I can't figure out how. Please help. Tom From colin.newell at gmail.com Thu Jun 10 06:13:31 2010 From: colin.newell at gmail.com (Colin Newell) Date: Thu, 10 Jun 2010 14:13:31 +0100 Subject: Regular Expression Annoyance In-Reply-To: <20100610124129.GN2208@eborcom.com> References: <20100610124129.GN2208@eborcom.com> Message-ID: I'm of the opinion that you're trying to hard and that your solution is perfectly reasonable if a little confusing. I think you could live with that number of statements, I'd just tweak the way it reads so that it's more obvious that the content regex and diag come as a direct consequence of failure. Colin. On Thu, Jun 10, 2010 at 1:41 PM, Tom Hukins wrote: > Hello, > > I'm writing a Test::WWW::Mechanize script to help me test the Web > interface to one of the systems I babysit. > > I have something like the following: > ?$mech->content_unlike( qr/Error: ([^>]+)/, 'No error message' ); > ?diag $1 if $1; > > So, if my test script encounters an error, I get to see it. ?At least, > that's the plan. ?But $1 never contains anything. > > Here's why: > ?perl -E 'sub foo { $_[0] =~ /Hi (\w+)/; } foo("Hi Tom"); say "Hello $1";' > > $1 doesn't exist in the scope I diag() or say() in because the regular > expression ran in a different scope. ?This makes sense: ?generally, I > wouldn't want different scopes to interfere with each other. > > So I've written: > ?$mech->content_unlike( qr/Error: ([^>]+)/, 'No error message' ) || > ? ?$mech->content() =~ qr/Error: ([^>]+)/ && > ? ?diag $1; > > But that feels horrid and long winded. ?I like writing succinct, > expressive code. ?And I can't figure out how. ?Please help. > > Tom > _______________________________________________ > MiltonKeynes-pm mailing list > MiltonKeynes-pm at pm.org > http://mail.pm.org/mailman/listinfo/miltonkeynes-pm > From tom at eborcom.com Thu Jun 10 06:33:48 2010 From: tom at eborcom.com (Tom Hukins) Date: Thu, 10 Jun 2010 14:33:48 +0100 Subject: Regular Expression Annoyance In-Reply-To: References: <20100610124129.GN2208@eborcom.com> Message-ID: <20100610133348.GP2208@eborcom.com> On Thu, Jun 10, 2010 at 02:13:31PM +0100, Colin Newell wrote: > I'm of the opinion that you're trying to hard and that your solution > is perfectly reasonable if a little confusing. Thanks, Colin. Maybe I'm frustrated because Perl often fits with the way I think, just not in this case. Now I wonder whether Perl really does fit the way I think or whether I do things in a Perlish way after 15 years of brainwashing.. Tom From Tony.Edwardson at lchclearnet.com Fri Jun 11 04:06:12 2010 From: Tony.Edwardson at lchclearnet.com (Tony Edwardson) Date: Fri, 11 Jun 2010 12:06:12 +0100 Subject: Anyone free on short notice fancy working in the City ? Message-ID: <8FC4575E52D65D469A9511598C6843F08B98FAECBF@EXCPR2.corp.lch.com> ++++++++++++++++++++++++++++++++++++++++++++++++++++++ Please Read The Disclaimer At The Bottom Of This Email ++++++++++++++++++++++++++++++++++++++++++++++++++++++ LCH.Clearnet are looking for someone urgently (i.e within 1 month) to help me manage Murex environments . I use perl heavily and so need someone to develop my scripts as requirements change. They use OO perl (Moose), XML, Template toolkit, Log::Log4perl Good rate of pay probably available too The downside is you would have to work with me ! Tony Edwardson Swapclear Environments Lead ----------------------------------------------------- LCH.Clearnet Ltd Email: tony.edwardson at lchclearnet.com Office: 0207 426 7569 www.lchclearnet.com ************************************************************************************************* This email is intended for the named recipient(s) only. Its contents are confidential and may only be retained by the named recipient(s) and may only be copied or disclosed with the consent of LCH.Clearnet Limited and/or LCH.Clearnet SA. If you are not an intended recipient please delete this e-mail and notify postmaster at lchclearnet.com. LCH.Clearnet Limited, LCH.Clearnet SA and each other member of the LCH.Clearnet Group accept no liability, including liability for negligence, in respect of any statement in this email. The contents of this email are subject to contract in all cases, and LCH.Clearnet Limited and/or LCH.Clearnet SA makes no contractual commitment save where confirmed by hard copy. Cet e-mail et toutes les pi?ces jointes (ci-apr?s le "message") sont confidentiels et ?tablis ? l'intention exclusive de ses destinataires. Toute utilisation de ce message non conforme ? sa destination, toute diffusion ou toute publication, est interdite, sauf autorisation expresse de LCH.Clearnet Limited et/ou LCH.Clearnet SA. Si ce message vous a ?t? adress? par erreur, merci de le d?truire et d'en avertir imm?diatement postmaster at lchclearnet.com. LCH.Clearnet Limited, LCH.Clearnet SA et les autres entit?s du groupe LCH.Clearnet Group, ne peuvent en aucun cas ?tre tenues responsables au titre de ce message ? moins qu?il n?ait fait l?objet d?un contrat sign?. LCH.Clearnet Limited, Registered Office: Aldgate House, 33 Aldgate High Street, London EC3N 1EA. Recognised as a Clearing House under the Financial Services & Markets Act 2000. Reg in England No.25932 Telephone: +44 20 7426 7000 Internet: http://www.lchclearnet.com LCH.Clearnet SA, Si?ge Social, 18 rue du Quatre Septembre, 75002 Paris, Chambre de Compensation conform?ment au Code Mon?taire et Financier. ************************************************************************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From pm at flodhest.net Sat Jun 12 09:49:25 2010 From: pm at flodhest.net (Jan Henning Thorsen) Date: Sat, 12 Jun 2010 18:49:25 +0200 Subject: Regular Expression Annoyance In-Reply-To: <20100610133348.GP2208@eborcom.com> References: <20100610124129.GN2208@eborcom.com> <20100610133348.GP2208@eborcom.com> Message-ID: Can't you just store the value of $1? Like: my $s; $mech->content_unlike( ($s) = qr/Error: ([^>]+)/, 'No error message' ); diag $s if $s; ? On Thu, Jun 10, 2010 at 3:33 PM, Tom Hukins wrote: > On Thu, Jun 10, 2010 at 02:13:31PM +0100, Colin Newell wrote: >> I'm of the opinion that you're trying to hard and that your solution >> is perfectly reasonable if a little confusing. > > Thanks, Colin. ?Maybe I'm frustrated because Perl often fits with the > way I think, just not in this case. > > Now I wonder whether Perl really does fit the way I think or whether I > do things in a Perlish way after 15 years of brainwashing.. > > Tom > _______________________________________________ > MiltonKeynes-pm mailing list > MiltonKeynes-pm at pm.org > http://mail.pm.org/mailman/listinfo/miltonkeynes-pm > From tom at eborcom.com Sun Jun 13 07:22:29 2010 From: tom at eborcom.com (Tom Hukins) Date: Sun, 13 Jun 2010 15:22:29 +0100 Subject: Regular Expression Annoyance In-Reply-To: References: <20100610124129.GN2208@eborcom.com> <20100610133348.GP2208@eborcom.com> Message-ID: <20100613142228.GQ2208@eborcom.com> On Sat, Jun 12, 2010 at 06:49:25PM +0200, Jan Henning Thorsen wrote: > Can't you just store the value of $1? Like: > > my $s; > $mech->content_unlike( ($s) = qr/Error: ([^>]+)/, 'No error message' ); > diag $s if $s; No, you can't: perl -e 'use Test::More "no_plan"; like( "X", ($x) = qr/(X)/ ); diag $X' Tom From jhthorsen at cpan.org Sun Jun 13 08:00:49 2010 From: jhthorsen at cpan.org (Jan Henning Thorsen) Date: Sun, 13 Jun 2010 17:00:49 +0200 Subject: Regular Expression Annoyance In-Reply-To: <20100613142228.GQ2208@eborcom.com> References: <20100610124129.GN2208@eborcom.com> <20100610133348.GP2208@eborcom.com> <20100613142228.GQ2208@eborcom.com> Message-ID: Oh. Of course not :/ I think it's a bit weird (inconsistent?) that you need to localize some variables, while some others get "magically" localized... It is kind of good though, since depending on $1 to survive through someone else subroutine could potentially cause bugs later on. I wonder though if you could predefine &Test::Builder::eval or &Test::Builder::ok to snatch the variables... ;) ___ .jht On Sun, Jun 13, 2010 at 4:22 PM, Tom Hukins wrote: > On Sat, Jun 12, 2010 at 06:49:25PM +0200, Jan Henning Thorsen wrote: >> Can't you just store the value of $1? Like: >> >> ?my $s; >> ?$mech->content_unlike( ($s) = qr/Error: ([^>]+)/, 'No error message' ); >> ?diag $s if $s; > > No, you can't: > perl -e 'use Test::More "no_plan"; like( "X", ($x) = qr/(X)/ ); diag $X' > > Tom > _______________________________________________ > MiltonKeynes-pm mailing list > MiltonKeynes-pm at pm.org > http://mail.pm.org/mailman/listinfo/miltonkeynes-pm > From jhthorsen at cpan.org Sun Jun 13 08:06:28 2010 From: jhthorsen at cpan.org (Jan Henning Thorsen) Date: Sun, 13 Jun 2010 17:06:28 +0200 Subject: Regular Expression Annoyance In-Reply-To: References: <20100610124129.GN2208@eborcom.com> <20100610133348.GP2208@eborcom.com> <20100613142228.GQ2208@eborcom.com> Message-ID: What about: perl -e 'use Test::More "no_plan"; like("X", qr/(X)(?{$x=$1})/ ); diag $x' Too bad this is also experimental code (?) On Sun, Jun 13, 2010 at 5:00 PM, Jan Henning Thorsen wrote: > Oh. Of course not :/ > > I think it's a bit weird (inconsistent?) that you need to localize > some variables, while some others get "magically" localized... It is > kind of good though, since depending on $1 to survive through someone > else subroutine could potentially cause bugs later on. > > I wonder though if you could predefine &Test::Builder::eval or > &Test::Builder::ok to snatch the variables... ;) > > ___ > .jht > > On Sun, Jun 13, 2010 at 4:22 PM, Tom Hukins wrote: >> On Sat, Jun 12, 2010 at 06:49:25PM +0200, Jan Henning Thorsen wrote: >>> Can't you just store the value of $1? Like: >>> >>> ?my $s; >>> ?$mech->content_unlike( ($s) = qr/Error: ([^>]+)/, 'No error message' ); >>> ?diag $s if $s; >> >> No, you can't: >> perl -e 'use Test::More "no_plan"; like( "X", ($x) = qr/(X)/ ); diag $X' >> >> Tom >> _______________________________________________ >> MiltonKeynes-pm mailing list >> MiltonKeynes-pm at pm.org >> http://mail.pm.org/mailman/listinfo/miltonkeynes-pm >> > From tom at eborcom.com Sun Jun 13 14:35:05 2010 From: tom at eborcom.com (Tom Hukins) Date: Sun, 13 Jun 2010 22:35:05 +0100 Subject: Regular Expression Annoyance In-Reply-To: References: <20100610124129.GN2208@eborcom.com> <20100610133348.GP2208@eborcom.com> <20100613142228.GQ2208@eborcom.com> Message-ID: <20100613213505.GS2208@eborcom.com> On Sun, Jun 13, 2010 at 05:06:28PM +0200, Jan Henning Thorsen wrote: > What about: > > perl -e 'use Test::More "no_plan"; like("X", qr/(X)(?{$x=$1})/ ); diag $x' Thanks, that's clever and it does the job. I still think I like Colin's "stop trying so hard" approach best, though. Tom From tony.edwardson at usa.net Mon Jun 14 11:20:28 2010 From: tony.edwardson at usa.net (Tony Edwardson) Date: Mon, 14 Jun 2010 19:20:28 +0100 Subject: Milton Keynes Perl Mongers Technical Meeting: Tuesday 15th June, 2010 Message-ID: <4C1672EC.6020908@usa.net> Hi All Just a reminder that the next Technical meet for Milton Keynes PM is tomorrow night. Would those of you doing a talk please send me your slides (if you have done them yet !) It all kicks of at 19:15 so please try and get there for 19:00 To repeat the directions :- The meeting is in the south east section of the Venables Building, nearest the Inner East Parking on the campus map. Take the path (marked in orange on the campus map) west from the car park toward the centre of campus. Take a right under an archway in to the courtyard area bound by Venables South, East, and South East, keeping right (heading North East on the campus map), behind the building section marked South East. You will find a double door on your right, which is Entrance G at the South East section of Venables Building. We'll see you there, as these are usually access controlled doors, so you will probably need to be let in. If you haven't attended one of our meetings at the OU before, you might want to ask for someone's phone number in case you have trouble finding us. If you need a lift to the meeting, please ask our mailing list or IRC channel (see http://miltonkeynes.pm.org/ for details). Cheers Tony From tom at eborcom.com Wed Jun 16 03:43:02 2010 From: tom at eborcom.com (Tom Hukins) Date: Wed, 16 Jun 2010 11:43:02 +0100 Subject: Milton Keynes Perl Mongers Technical Meeting: Tuesday 15th June, 2010 In-Reply-To: <4C1672EC.6020908@usa.net> References: <4C1672EC.6020908@usa.net> Message-ID: <20100616104302.GL37487@eborcom.com> On Mon, Jun 14, 2010 at 07:20:28PM +0100, Tony Edwardson wrote: > Would those of you doing a talk please send me your slides (if you have > done them yet !) Tony and the speakers have been very organised, so our Web page now has links to all the slides: http://miltonkeynes.pm.org/ Tom From andyfrommk at gmail.com Tue Jun 22 13:51:18 2010 From: andyfrommk at gmail.com (Andy Selby) Date: Tue, 22 Jun 2010 21:51:18 +0100 Subject: Meeting: Tuesday 29th of June, Do you know what else is going on then? Message-ID: The monthly MKLUG/MiltonKeynes.pm meet-up is nearly upon us! As ever, it will be held at the Wetherspoons pub, near the railway station (not the one in the snow dome), next door to Chiquitos: http://osm.org/go/eu4qJDHoE-- Starting from 7pm, and going on till the last people stumble off home. We usually inhabit one of the two large curved tables in front of the bar. Feel free to bring your laptop/Linux device along if you want a hand/to show off. Our PM/LUG coincides with a World Cup game at 8:30, probably Brazil versus Spain which will be quite popular so expect the pub to be packed, also there will be an earlier game kicking off at 4:00 which we will run into the back of. Its to late to reschedule or choose another venue so lets hope for the best and that we get one of our regular tables. From andyfrommk at gmail.com Tue Jun 29 09:22:11 2010 From: andyfrommk at gmail.com (Andy Selby) Date: Tue, 29 Jun 2010 17:22:11 +0100 Subject: Meeting: Tuesday 29th of June, Do you know what else is going on then? In-Reply-To: References: Message-ID: Just to remind everyone, this is tonight On 22 June 2010 21:51, Andy Selby wrote: > The monthly MKLUG/MiltonKeynes.pm meet-up is nearly upon us! > > As ever, it will be held at the Wetherspoons pub, near the railway > station (not the one in the snow dome), next door to Chiquitos: > > http://osm.org/go/eu4qJDHoE-- > > Starting from 7pm, and going on till the last people stumble off home. > We usually inhabit one of the two large curved tables in front of the bar. > Feel free to bring your laptop/Linux device along if you want a hand/to > show off. > > Our PM/LUG coincides with a World Cup game at 8:30, probably Brazil > versus Spain which will be quite popular so expect the pub to be > packed, also there will be an earlier game kicking off at 4:00 which > we will run into the back of. > Its to late to reschedule or choose another venue so lets hope for the > best and that we get one of our regular tables. >