From alecclews at gmail.com Sat Jan 2 19:55:31 2010 From: alecclews at gmail.com (Alec Clews) Date: Sun, 03 Jan 2010 14:55:31 +1100 Subject: [Melbourne-pm] OSDC.TW call for papers Message-ID: <4B401533.8040505@gmail.com> * OSDC.TW calls for papers +--------------------------------------------------------------------+ | OSDC.TW calls for papers | | posted by brian_d_foy on Saturday January 02, @09:24 (Others) | | http://use.perl.org/article.pl?sid=10/01/02/134248 | +--------------------------------------------------------------------+ [0]hcchien writes "We are glad to announce the [1]OSDC.TW 2010 will be at 2010/4/24-25 in Acadmeia Sinica, Taipei. So it's time to call for papers now. If you work for any interesting open source projects. It is a good time to introduce your projects to the open source developers in Taiwan. And sure, we would like to get the talks about the developing tips and experence sharing. The deadline of call of paper is 31th, January, 2010. And we accept three kind of talks: tutorial: 3 hours, and we would provide the flight fee if the speakers are out of Taiwan. session: 1 hour. lightning talk: 5 minute. If you are interesting to submit the papers, please isending mail to [2]submit at osdc.tw, and including the author intro and extract." Discuss this story at: http://use.perl.org/comments.pl?sid=10/01/02/134248 Links: 0. mailto:hcchien at hcchien.org 1. http://osdc.tw/ 2. mailto:submit at osdc.tw -- Alec Clews Personal Melbourne, Australia. Jabber: alecclews at jabber.org.au PGPKey ID: 0x9BBBFC7C Blog http://alecthegeek.wordpress.com/ From jarich at perltraining.com.au Sun Jan 10 16:40:47 2010 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Mon, 11 Jan 2010 11:40:47 +1100 Subject: [Melbourne-pm] Meeting on Wednesday 11th January? Message-ID: <4B4A738F.3090106@perltraining.com.au> G'day folk, Wednesday would be our usual meeting time, although meetings in January have often been hit-and-miss. What would you like: [ ] - No meeting/I won't come anyway [ ] - Lightning talk meeting [ ] - Pub/dinner meeting Thanks, J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From pat at patspam.com Sun Jan 10 17:04:34 2010 From: pat at patspam.com (Patrick Donelan) Date: Mon, 11 Jan 2010 12:04:34 +1100 Subject: [Melbourne-pm] Meeting on Wednesday 11th January? In-Reply-To: <4B4A738F.3090106@perltraining.com.au> References: <4B4A738F.3090106@perltraining.com.au> Message-ID: <42321ee21001101704l579edfffu333c18d5e523d4ba@mail.gmail.com> Did you mean Wednesday 13th Jan? On Mon, Jan 11, 2010 at 11:40 AM, Jacinta Richardson < jarich at perltraining.com.au> wrote: > G'day folk, > > Wednesday would be our usual meeting time, although meetings in January > have > often been hit-and-miss. What would you like: > > [ ] - No meeting/I won't come anyway > [ ] - Lightning talk meeting > [ ] - Pub/dinner meeting > > Thanks, > > J > > -- > ("`-''-/").___..--''"`-._ | Jacinta Richardson | > `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | > (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | > _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | > (il),-'' (li),' ((!.-' | www.perltraining.com.au | > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jarich at perltraining.com.au Sun Jan 10 18:12:18 2010 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Mon, 11 Jan 2010 13:12:18 +1100 Subject: [Melbourne-pm] Meeting on Wednesday 11th January? In-Reply-To: <42321ee21001101704l579edfffu333c18d5e523d4ba@mail.gmail.com> References: <4B4A738F.3090106@perltraining.com.au> <42321ee21001101704l579edfffu333c18d5e523d4ba@mail.gmail.com> Message-ID: <4B4A8902.7050508@perltraining.com.au> Patrick Donelan wrote: > Did you mean Wednesday 13th Jan? Indeed. J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From keley at internode.on.net Sun Jan 10 18:27:17 2010 From: keley at internode.on.net (keley at internode.on.net) Date: Mon, 11 Jan 2010 12:57:17 +1030 Subject: [Melbourne-pm] Meeting on Wednesday 11th January? Message-ID: <61916.1263176837@internode.on.net> Lightning talk meeting (as listener) Regards, Ken Eley On Mon 11/01/10 11:10 AM , Jacinta Richardson jarich at perltraining.com.au sent: G'day folk, Wednesday would be our usual meeting time, although meetings in January have often been hit-and-miss. What would you like: [ ] - No meeting/I won't come anyway [ ] - Lightning talk meeting [ ] - Pub/dinner meeting Thanks, J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | http://www.perltraining.com.au [1]">www.perltraining.com.au | _______________________________________________ Melbourne-pm mailing list Melbourne-pm at pm.org http://mail.pm.org/mailman/listinfo/melbourne-pm [2] Links: ------ [1] http://www.perltraining.com.au [2] http://webmail.internode.on.net/parse.php?redirect=http%3A%2F%2Fmail.pm.org%2Fmailman%2Flistinfo%2Fmelbourne-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.G.Ryan at team.telstra.com Sun Jan 10 19:38:40 2010 From: Martin.G.Ryan at team.telstra.com (Ryan, Martin G) Date: Mon, 11 Jan 2010 14:38:40 +1100 Subject: [Melbourne-pm] Meeting on Wednesday 11th January? In-Reply-To: <4B4A738F.3090106@perltraining.com.au> References: <4B4A738F.3090106@perltraining.com.au> Message-ID: <589EE331794E0B4DA62A9ADE89BCB4057CC0D63E76@WSMSG3103V.srv.dir.telstra.com> [ ] - No meeting/I won't come anyway [X] - Lightning talk meeting [ ] - Pub/dinner meeting Martin From toby.corkindale at strategicdata.com.au Sun Jan 10 19:43:12 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Mon, 11 Jan 2010 14:43:12 +1100 Subject: [Melbourne-pm] Meeting on Wednesday 11th January? In-Reply-To: <4B4A738F.3090106@perltraining.com.au> References: <4B4A738F.3090106@perltraining.com.au> Message-ID: <4B4A9E50.70506@strategicdata.com.au> Jacinta Richardson wrote: > G'day folk, > > Wednesday would be our usual meeting time, although meetings in January have > often been hit-and-miss. What would you like: > > [ ] - No meeting/I won't come anyway > [X] - Lightning talk meeting > [ ] - Pub/dinner meeting -Toby From simon at unisolve.com.au Mon Jan 11 14:42:48 2010 From: simon at unisolve.com.au (Simon Taylor) Date: Tue, 12 Jan 2010 09:42:48 +1100 Subject: [Melbourne-pm] Meeting on Wednesday In-Reply-To: <4B4A738F.3090106@perltraining.com.au> References: <4B4A738F.3090106@perltraining.com.au> Message-ID: <4B4BA968.7080402@unisolve.com.au> Hi Jacinta, > [ ] - No meeting/I won't come anyway > [X] - Lightning talk meeting > [ ] - Pub/dinner meeting Cheers, Simon From melbourne-pm at popcorn.cx Mon Jan 11 18:46:45 2010 From: melbourne-pm at popcorn.cx (Stephen Edmonds) Date: Tue, 12 Jan 2010 13:46:45 +1100 Subject: [Melbourne-pm] Meeting on Wednesday 13th January? In-Reply-To: <4B4A738F.3090106@perltraining.com.au> References: <4B4A738F.3090106@perltraining.com.au> Message-ID: <4B4BE295.1040703@popcorn.cx> > [ ] - No meeting/I won't come anyway > [X] - Lightning talk meeting > [X] - Pub/dinner meeting But that's conditional of having enough notice. So a consensus by tonight would be good. Thanks, Stephen From jarich at perltraining.com.au Mon Jan 11 21:02:43 2010 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Tue, 12 Jan 2010 16:02:43 +1100 Subject: [Melbourne-pm] Next meeting: tomorrow night: Wed Jan 13th Message-ID: <4B4C0273.6010502@perltraining.com.au> G'day Melbourne PM, Our next meeting is tomorrow night where we're going to have a bunch of lightning talks. I haven't pre-arranged any lightning talks for the meeting yet, so please seriously consider presenting one. Standard rules: You get 5 minutes to talk, slides are optional, topic can be as specific or as general as you like, but try to stay within the time limits. If you have never presented at Melbourne PM before, please do so tomorrow night. When: Wednesday, 6:30pm Where: Remasys Pty Ltd Level 1 180 Flinders St MELBOURNE VIC 3121 What: Lightning talks Pub See you there! J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From ddick at iinet.net.au Mon Jan 11 21:15:19 2010 From: ddick at iinet.net.au (David Dick) Date: Tue, 12 Jan 2010 16:15:19 +1100 Subject: [Melbourne-pm] Next meeting: tomorrow night: Wed Jan 13th In-Reply-To: <4B4C0273.6010502@perltraining.com.au> References: <4B4C0273.6010502@perltraining.com.au> Message-ID: <4B4C0567.9020903@iinet.net.au> On 12/01/10 16:02, Jacinta Richardson wrote: > Where: Remasys Pty Ltd > Level 1 > 180 Flinders St > MELBOURNE VIC 3121 > *zonk* My apologies, but i've left Remasys, so i'm not sure who could let us in. From toby.corkindale at strategicdata.com.au Mon Jan 11 21:16:05 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Tue, 12 Jan 2010 16:16:05 +1100 Subject: [Melbourne-pm] Next meeting: tomorrow night: Wed Jan 13th In-Reply-To: <4B4C0273.6010502@perltraining.com.au> References: <4B4C0273.6010502@perltraining.com.au> Message-ID: <4B4C0595.9060904@strategicdata.com.au> Jacinta Richardson wrote: > G'day Melbourne PM, > > Our next meeting is tomorrow night where we're going to have a bunch of > lightning talks. I haven't pre-arranged any lightning talks for the meeting > yet, so please seriously consider presenting one. > > Standard rules: You get 5 minutes to talk, slides are optional, topic can be as > specific or as general as you like, but try to stay within the time limits. If > you have never presented at Melbourne PM before, please do so tomorrow night. I'm happy to do one on using Tesseract with KinoSearch to do automated document searching. I should really port it to using PostgreSQL FTS instead though, but then there'd be (almost) no Perl component to the talk any more ;) -Toby From jarich at perltraining.com.au Mon Jan 11 21:45:35 2010 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Tue, 12 Jan 2010 16:45:35 +1100 Subject: [Melbourne-pm] Next meeting: tomorrow night: Wed Jan 13th In-Reply-To: <4B4C0567.9020903@iinet.net.au> References: <4B4C0273.6010502@perltraining.com.au> <4B4C0567.9020903@iinet.net.au> Message-ID: <4B4C0C7F.9060802@perltraining.com.au> David Dick wrote: > On 12/01/10 16:02, Jacinta Richardson wrote: > >> Where: Remasys Pty Ltd >> Level 1 >> 180 Flinders St >> MELBOURNE VIC 3121 >> > > *zonk* My apologies, but i've left Remasys, so i'm not sure who could > let us in. Fair enough, I missed that piece of news along the way. Anyone else have somewhere for us to meet tomorrow night? I think perhaps it might be better to postpone the meeting, or just go to a pub, rather than try to find a venue in the last 15 minutes before people go home. J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From toby.corkindale at strategicdata.com.au Mon Jan 11 22:29:20 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Tue, 12 Jan 2010 17:29:20 +1100 Subject: [Melbourne-pm] Promoting old-school file handles to io::handles Message-ID: <4B4C16C0.50703@strategicdata.com.au> Old-school Perl file handles looked like this: open(INPUT, "<$filename"); Then later they could be: open(my $input, "<$filename"); New-school filehandles are: my $input = IO::File->new($filename, 'r'); And interregnum filehandles were: my $fh = FileHandle->new($filename, 'r'); I want to have a method which accepts all, but operates upon them using new-school object methods, ie. $file->autoflush(1) or $file->input_line_number; Currently I'm doing it via the following simplified code example, but I wondered if there was a more elegant solution? package Thingy; use Moose; use IO::Handle; has 'input' => ( is => 'rw', isa => 'FileHandle', # Native Moose type, not same as FileHandle ); around 'BUILDARGS' => sub { my ($orig, $class, $args) = @_; unless (blessed $args{input} and $args{input}->isa('IO::Handle')) { $args->{input} = IO::Handle->new->fdopen(fileno($args->{input})); } return $args; }; From toby.corkindale at strategicdata.com.au Mon Jan 11 23:09:24 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Tue, 12 Jan 2010 18:09:24 +1100 Subject: [Melbourne-pm] Promoting old-school file handles to io::handles In-Reply-To: References: <4B4C16C0.50703@strategicdata.com.au> Message-ID: <4B4C2024.8050305@strategicdata.com.au> Alfie John wrote: > Hey Toby, > > When you use IO::Handle etc, all regular handles are automagically > blessed into IO::Handle objects: > > -- 8< -- > > $ perl -we 'use IO::File; open my $fh, ">test.txt"; $fh->print( "hello > world" )' > $ cat test.txt > Hello world > > -- >8 -- > > Pretty elegant huh :) I had seen someone else mention that, but when I tried it, it failed - I think because you need to "use IO::File" in the calling class before opening the file -- and I don't have control over the calling code. > As for FileHandle, haven't used it. Would subclassing FileHandle do what > you want? All that Moose stuff looks a bit ugly. Hmm, same problem as above -- how to deal with not having control over the point where it's opened, just receiving the parameter into your code. thanks! Toby > On Tue, Jan 12, 2010 at 5:29 PM, Toby Corkindale > > wrote: > > Old-school Perl file handles looked like this: > > open(INPUT, "<$filename"); > > Then later they could be: > > open(my $input, "<$filename"); > > New-school filehandles are: > > my $input = IO::File->new($filename, 'r'); > > And interregnum filehandles were: > > my $fh = FileHandle->new($filename, 'r'); > > I want to have a method which accepts all, but operates upon them > using new-school object methods, ie. $file->autoflush(1) or > $file->input_line_number; > > > Currently I'm doing it via the following simplified code example, > but I wondered if there was a more elegant solution? > > > package Thingy; > use Moose; > use IO::Handle; > > has 'input' => ( > is => 'rw', > isa => 'FileHandle', # Native Moose type, not same as FileHandle > ); > > around 'BUILDARGS' => sub { > my ($orig, $class, $args) = @_; > unless (blessed $args{input} and $args{input}->isa('IO::Handle')) { > $args->{input} = IO::Handle->new->fdopen(fileno($args->{input})); > } > return $args; > }; > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > > -- Strategic Data Pty Ltd Ph: 03 9340 9000 From alec.clews at gmail.com Tue Jan 12 13:23:45 2010 From: alec.clews at gmail.com (Alec Clews) Date: Wed, 13 Jan 2010 08:23:45 +1100 Subject: [Melbourne-pm] Next meeting: tomorrow night: Wed Jan 13th In-Reply-To: <4B4C0273.6010502@perltraining.com.au> References: <4B4C0273.6010502@perltraining.com.au> Message-ID: <4B4CE861.50700@gmail.com> Don't Beer De Lux have a room? They also have free Wifi. Shall I call them and see if the room is free? How many would turn up? Jacinta Richardson wrote: > G'day Melbourne PM, > > Our next meeting is tomorrow night where we're going to have a bunch of > lightning talks. I haven't pre-arranged any lightning talks for the meeting > yet, so please seriously consider presenting one. > > Standard rules: You get 5 minutes to talk, slides are optional, topic can be as > specific or as general as you like, but try to stay within the time limits. If > you have never presented at Melbourne PM before, please do so tomorrow night. > > When: Wednesday, 6:30pm > > Where: Remasys Pty Ltd > Level 1 > 180 Flinders St > MELBOURNE VIC 3121 > > What: Lightning talks > Pub > > See you there! > > J > > -- Alec Clews Personal Melbourne, Australia. Jabber: alecclews at jabber.org.au PGPKey ID: 0x9BBBFC7C Blog http://alecthegeek.wordpress.com/ From gary.monson at gmail.com Tue Jan 12 13:37:03 2010 From: gary.monson at gmail.com (Gary Monson) Date: Wed, 13 Jan 2010 08:37:03 +1100 Subject: [Melbourne-pm] Next meeting: tomorrow night: Wed Jan 13th In-Reply-To: <4B4C0567.9020903@iinet.net.au> References: <4B4C0273.6010502@perltraining.com.au> <4B4C0567.9020903@iinet.net.au> Message-ID: <101f97241001121337k12ce1713k5d9d26633255fe1f@mail.gmail.com> 2010/1/12 David Dick : > *zonk* My apologies, but i've left Remasys, so i'm not sure who could let us > in. Yeah, I'm the new guy at Remasys, and unfortunately I'm not able to make it tonight, so I won't be able to let you guys in to have it here this time. Apologies for the late notice on that. Gary From alfiejohn at gmail.com Tue Jan 12 13:46:37 2010 From: alfiejohn at gmail.com (Alfie John) Date: Wed, 13 Jan 2010 08:46:37 +1100 Subject: [Melbourne-pm] Promoting old-school file handles to io::handles In-Reply-To: <4B4C2024.8050305@strategicdata.com.au> References: <4B4C16C0.50703@strategicdata.com.au> <4B4C2024.8050305@strategicdata.com.au> Message-ID: Hey, Seems to be working for me: -- TestFh.pm -- package TestFh; use strict; use warnings; use IO::File; sub test_fh { my ( $fh ) = @_; printf "fileno: %d\n", $fh->fileno(); } 1; -- test.pl -- #!/usr/bin/perl use strict; use warnings; use TestFh; open my $fh, ">test.txt" or die $!; TestFh::test_fh($fh); -- Output -- $ perl test.pl fileno: 3 So, unless I'm not understanding the problem, maybe Moose is getting in the way? Try writing a small test script to get what you want and then see if IO::Handle magic kicks in. Otherwise, i'm out of ideas :( Alfie On Tue, Jan 12, 2010 at 6:09 PM, Toby Corkindale < toby.corkindale at strategicdata.com.au> wrote: > Alfie John wrote: > >> Hey Toby, >> >> When you use IO::Handle etc, all regular handles are automagically blessed >> into IO::Handle objects: >> >> -- 8< -- >> >> $ perl -we 'use IO::File; open my $fh, ">test.txt"; $fh->print( "hello >> world" )' >> $ cat test.txt >> Hello world >> >> -- >8 -- >> >> Pretty elegant huh :) >> > > I had seen someone else mention that, but when I tried it, it failed - I > think because you need to "use IO::File" in the calling class before opening > the file -- and I don't have control over the calling code. > > > As for FileHandle, haven't used it. Would subclassing FileHandle do what >> you want? All that Moose stuff looks a bit ugly. >> > > Hmm, same problem as above -- how to deal with not having control over the > point where it's opened, just receiving the parameter into your code. > > thanks! > Toby > > On Tue, Jan 12, 2010 at 5:29 PM, Toby Corkindale < >> toby.corkindale at strategicdata.com.au > toby.corkindale at strategicdata.com.au>> wrote: >> >> Old-school Perl file handles looked like this: >> >> open(INPUT, "<$filename"); >> >> Then later they could be: >> >> open(my $input, "<$filename"); >> >> New-school filehandles are: >> >> my $input = IO::File->new($filename, 'r'); >> >> And interregnum filehandles were: >> >> my $fh = FileHandle->new($filename, 'r'); >> >> I want to have a method which accepts all, but operates upon them >> using new-school object methods, ie. $file->autoflush(1) or >> $file->input_line_number; >> >> >> Currently I'm doing it via the following simplified code example, >> but I wondered if there was a more elegant solution? >> >> >> package Thingy; >> use Moose; >> use IO::Handle; >> >> has 'input' => ( >> is => 'rw', >> isa => 'FileHandle', # Native Moose type, not same as FileHandle >> ); >> >> around 'BUILDARGS' => sub { >> my ($orig, $class, $args) = @_; >> unless (blessed $args{input} and $args{input}->isa('IO::Handle')) { >> $args->{input} = IO::Handle->new->fdopen(fileno($args->{input})); >> } >> return $args; >> }; >> _______________________________________________ >> Melbourne-pm mailing list >> Melbourne-pm at pm.org >> >> http://mail.pm.org/mailman/listinfo/melbourne-pm >> >> >> > > -- > Strategic Data Pty Ltd > Ph: 03 9340 9000 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alec.clews at gmail.com Tue Jan 12 15:14:01 2010 From: alec.clews at gmail.com (Alec Clews) Date: Wed, 13 Jan 2010 10:14:01 +1100 Subject: [Melbourne-pm] Next meeting: tomorrow night: Wed Jan 13th In-Reply-To: <4B4CE861.50700@gmail.com> References: <4B4C0273.6010502@perltraining.com.au> <4B4CE861.50700@gmail.com> Message-ID: <4B4D0239.4050206@gmail.com> Alec Clews wrote: > Don't Beer De Lux have a room? They also have free Wifi. No room. Shall we go somewhere else? Hard to beat free wifi..... > Jacinta Richardson wrote: >> G'day Melbourne PM, >> >> Our next meeting is tomorrow night where we're going to have a bunch of >> lightning talks. I haven't pre-arranged any lightning talks for the >> meeting >> yet, so please seriously consider presenting one. >> >> Standard rules: You get 5 minutes to talk, slides are optional, topic >> can be as >> specific or as general as you like, but try to stay within the time >> limits. If >> you have never presented at Melbourne PM before, please do so >> tomorrow night. >> >> When: Wednesday, 6:30pm >> >> Where: Remasys Pty Ltd >> Level 1 >> 180 Flinders St >> MELBOURNE VIC 3121 >> >> What: Lightning talks >> Pub >> >> See you there! >> >> J >> > > -- Alec Clews Personal Melbourne, Australia. Jabber: alecclews at jabber.org.au PGPKey ID: 0x9BBBFC7C Blog http://alecthegeek.wordpress.com/ From toby.corkindale at strategicdata.com.au Tue Jan 12 16:34:19 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 13 Jan 2010 11:34:19 +1100 Subject: [Melbourne-pm] Promoting old-school file handles to io::handles In-Reply-To: References: <4B4C16C0.50703@strategicdata.com.au> <4B4C2024.8050305@strategicdata.com.au> Message-ID: <4B4D150B.9090205@strategicdata.com.au> Alfie John wrote: > Hey, > > Seems to be working for me: [snip code] > So, unless I'm not understanding the problem, maybe Moose is getting in > the way? Try writing a small test script to get what you want and then > see if IO::Handle magic kicks in. Otherwise, i'm out of ideas :( I've found it! Some of the calling code was passing me filehandles that were, get this, overloaded fileglobs that were blessed. Like this: package Fh; sub new { # ... return bless \*FILEHANDLE; } sub DESTROY { close shift } However, apparently doing that stops the IO::File promotion magic from working. Who would guessed.. >.< From pjf at perltraining.com.au Tue Jan 12 18:14:52 2010 From: pjf at perltraining.com.au (Paul Fenwick) Date: Wed, 13 Jan 2010 13:14:52 +1100 Subject: [Melbourne-pm] Next meeting: tomorrow night: Wed Jan 13th In-Reply-To: <4B4D0239.4050206@gmail.com> References: <4B4C0273.6010502@perltraining.com.au> <4B4CE861.50700@gmail.com> <4B4D0239.4050206@gmail.com> Message-ID: <4B4D2C9C.9020704@perltraining.com.au> G'day Everyone, Alec Clews wrote: > No room. Shall we go somewhere else? Hard to beat free wifi..... If you're looking for an alternate venue, then I know that Horse Bazaar has free wifi. I don't imagine they'll be full on a Wednesday night. Unfortunately, I won't be able to make it in tonight; I have negative availability in the lead-up to LCA next week. Cheerio, Paul -- Paul Fenwick | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia | Fax: +61 3 9354 2681 From Martin.G.Ryan at team.telstra.com Tue Jan 12 18:24:22 2010 From: Martin.G.Ryan at team.telstra.com (Ryan, Martin G) Date: Wed, 13 Jan 2010 13:24:22 +1100 Subject: [Melbourne-pm] Promoting old-school file handles to io::handles In-Reply-To: <4B4D150B.9090205@strategicdata.com.au> References: <4B4C16C0.50703@strategicdata.com.au> <4B4C2024.8050305@strategicdata.com.au> <4B4D150B.9090205@strategicdata.com.au> Message-ID: <589EE331794E0B4DA62A9ADE89BCB4057CC0E28DB3@WSMSG3103V.srv.dir.telstra.com> Toby Corkindale says > Some of the calling code was passing me filehandles that were, get this, > overloaded fileglobs that were blessed. Like this: I have vague recollection that in early version of perl5 the *only* way you could pass filehandles into subs was via a typeglob reference. Martin From jarich at perltraining.com.au Tue Jan 12 18:40:24 2010 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Wed, 13 Jan 2010 13:40:24 +1100 Subject: [Melbourne-pm] SOCIAL MEET ONLY tonight (and that only maybe) Message-ID: <4B4D3298.5050802@perltraining.com.au> G'day folk, Due to a lack of firm venue plans; there won't be a normal Melbourne PM meeting tonight. Alec looks eager to meet at Beer Deluxe and enjoy their wifi; other venues have been suggested. Stay tuned to any announcement from him for further details. I hope to see you all on the 10th February. In the meantime, if your workplace wants to host some very friendly (and tidy!) folk every second Wednesday of the month... drop the mailing list a note. J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From alfiejohn at gmail.com Tue Jan 12 18:44:51 2010 From: alfiejohn at gmail.com (Alfie John) Date: Wed, 13 Jan 2010 13:44:51 +1100 Subject: [Melbourne-pm] Promoting old-school file handles to io::handles In-Reply-To: <589EE331794E0B4DA62A9ADE89BCB4057CC0E28DB3@WSMSG3103V.srv.dir.telstra.com> References: <4B4C16C0.50703@strategicdata.com.au> <4B4C2024.8050305@strategicdata.com.au> <4B4D150B.9090205@strategicdata.com.au> <589EE331794E0B4DA62A9ADE89BCB4057CC0E28DB3@WSMSG3103V.srv.dir.telstra.com> Message-ID: On Wed, Jan 13, 2010 at 1:24 PM, Ryan, Martin G < Martin.G.Ryan at team.telstra.com> wrote: > Toby Corkindale says > > > Some of the calling code was passing me filehandles that were, get this, > > overloaded fileglobs that were blessed. Like this: > > I have vague recollection that in early version of perl5 the *only* way you > could pass filehandles into subs was via a typeglob reference. > Of course! Forgot about that. Nice pickup Martin. Alfie > Martin > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From toby.corkindale at strategicdata.com.au Tue Jan 12 18:53:53 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 13 Jan 2010 13:53:53 +1100 Subject: [Melbourne-pm] [OT] Meeting intervals In-Reply-To: <4B4D3298.5050802@perltraining.com.au> References: <4B4D3298.5050802@perltraining.com.au> Message-ID: <4B4D35C1.1050303@strategicdata.com.au> Jacinta Richardson wrote: > G'day folk, > > Due to a lack of firm venue plans; there won't be a normal Melbourne PM meeting > tonight. Alec looks eager to meet at Beer Deluxe and enjoy their wifi; other > venues have been suggested. Stay tuned to any announcement from him for further > details. > > I hope to see you all on the 10th February. > > In the meantime, if your workplace wants to host some very friendly (and tidy!) > folk every second Wednesday of the month... drop the mailing list a note. As an aside - does anyone else frequently mis-parse declarations like "every second wednesday of the month"? I mean, if I spread out my cutlery draw's contents into a long line of forks, spoons and knives, and said to someone "take every second spoon from the draw", I'd assume they'd pick up half the spoons there, rather than just the second one in the line. I guess it's just a failing of our language; both are valid interpretations. How about "It occurs monthly on the second wednesday of the month", although that bugs me as well. Are there any groups out there who meet by other iterations? ie. Every second week. Every fourth week. Every 36.525 days, to get ten meetings a year. (The .5 would be great, you could alternately have lunch and evening meetings! :) Now, back to your regularly scheduled viewing.. From Martin.G.Ryan at team.telstra.com Tue Jan 12 18:59:18 2010 From: Martin.G.Ryan at team.telstra.com (Ryan, Martin G) Date: Wed, 13 Jan 2010 13:59:18 +1100 Subject: [Melbourne-pm] [OT] Meeting intervals In-Reply-To: <4B4D35C1.1050303@strategicdata.com.au> References: <4B4D3298.5050802@perltraining.com.au> <4B4D35C1.1050303@strategicdata.com.au> Message-ID: <589EE331794E0B4DA62A9ADE89BCB4057CC0E28E91@WSMSG3103V.srv.dir.telstra.com> > Every 36.525 days, to get ten meetings a year. (The .5 would be great, > you could alternately have lunch and evening meetings! :) As long as you don't mind your evening meetings starting at midnight. :-) From alec.clews at gmail.com Tue Jan 12 19:03:07 2010 From: alec.clews at gmail.com (Alec Clews) Date: Wed, 13 Jan 2010 14:03:07 +1100 Subject: [Melbourne-pm] SOCIAL MEET ONLY tonight (and that only maybe) In-Reply-To: <4B4D3298.5050802@perltraining.com.au> References: <4B4D3298.5050802@perltraining.com.au> Message-ID: <4B4D37EB.10403@gmail.com> Jacinta Richardson wrote: > Due to a lack of firm venue plans; there won't be a normal Melbourne PM meeting > tonight. Alec looks eager to meet at Beer Deluxe and enjoy their wifi; other > venues have been suggested. Stay tuned to any announcement from him for further > details I am of course *only* interested in the free wifi. 6:30 onwards? I suggest we stick with Beer Deluxe as we all know the location? Also if anyone can talk me through the politics and process of become a CPAN contributer; and adopting an apparently orphaned module, I'd be very grateful. -- Alec Clews Personal Melbourne, Australia. Jabber: alecclews at jabber.org.au PGPKey ID: 0x9BBBFC7C Blog http://alecthegeek.wordpress.com/ From scottp at dd.com.au Tue Jan 12 19:25:01 2010 From: scottp at dd.com.au (Scott Penrose) Date: Tue, 12 Jan 2010 21:25:01 -0600 (CST) Subject: [Melbourne-pm] [OT] Meeting intervals In-Reply-To: <4B4D35C1.1050303@strategicdata.com.au> Message-ID: <5561832.528891263353101068.JavaMail.root@mail-4.01.com> ----- "Toby Corkindale" wrote: > As an aside - does anyone else frequently mis-parse declarations like > "every second wednesday of the month"? Yes it is a little confusing. It is common practice to use the expression though. We would say fortnightly if we meant every 2 weeks. Better to write "The second Wednesday of every month" :-) P.S. I can't make it tonight, I do plan to come to Melb.PM and OSDClub this year. I have a talk on using GeoExt if that is interesting, and I know Alec was interested in programming XSL. Scott -- http://scott.dd.com.au/ scottp at dd.com.au From benji at arsimagica.net Tue Jan 12 19:26:46 2010 From: benji at arsimagica.net (Benji Wakely) Date: Wed, 13 Jan 2010 14:26:46 +1100 Subject: [Melbourne-pm] [OT] Meeting intervals In-Reply-To: Your message of "Wed, 13 Jan 2010 13:53:53 +1100." <4B4D35C1.1050303@strategicdata.com.au> Message-ID: <201001130326.o0D3Qktt030955@arch.localnet> >As an aside - does anyone else frequently mis-parse declarations like >"every second wednesday of the month"? > >I mean, if I spread out my cutlery draw's contents into a long line of >forks, spoons and knives, and said to someone "take every second spoon >from the draw", I'd assume they'd pick up half the spoons there, rather >than just the second one in the line. Key difference between the two is that your cutlery drawer is a finite set. ...At least, I hope so. :) --Benji From toby.corkindale at strategicdata.com.au Tue Jan 12 19:27:58 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 13 Jan 2010 14:27:58 +1100 Subject: [Melbourne-pm] [OT] Meeting intervals In-Reply-To: <201001130326.o0D3Qktt030955@arch.localnet> References: <201001130326.o0D3Qktt030955@arch.localnet> Message-ID: <4B4D3DBE.9030703@strategicdata.com.au> Benji Wakely wrote: > Key difference between the two is that your cutlery drawer is a finite set. > ...At least, I hope so. It doesn't feel that way when I'm doing the washing up though, I can tell! ;) From alec.clews at gmail.com Tue Jan 12 19:38:27 2010 From: alec.clews at gmail.com (Alec Clews) Date: Wed, 13 Jan 2010 14:38:27 +1100 Subject: [Melbourne-pm] Scraping Media Wiki Message-ID: <4B4D4033.1040703@gmail.com> G'Day, I have some Media Wiki pages, laid out for the benefit of humans (irregularly) , with tables of values. Does anyone have a recommendation on a suitable module to scrap the some of the values? I figured WWW::Mechanize, but I've never used it. Cheers -- Alec Clews Personal Melbourne, Australia. Jabber: alecclews at jabber.org.au PGPKey ID: 0x9BBBFC7C Blog http://alecthegeek.wordpress.com/ From scottp at dd.com.au Tue Jan 12 19:49:02 2010 From: scottp at dd.com.au (scottp at dd.com.au) Date: Tue, 12 Jan 2010 21:49:02 -0600 (CST) Subject: [Melbourne-pm] Scraping Media Wiki In-Reply-To: <239501466.530501263354456573.JavaMail.root@mail-4.01.com> Message-ID: <844195963.530551263354542554.JavaMail.root@mail-4.01.com> I think it is a three part answer: * WWW:Mechanize or even just LWP to get the page * XML format may give you some benefits, such as Date modified * Then parse the content there are a number of wiki text parsers on CPAN, none of them great, but most ok. Converting to HTML may be your best bet, at least then it is in HTML table format. There are some Mediawiki API classes too, but I have not used them: * WWW::Mediawiki::Client * MediaWiki::API FYI, if you are parsing a whole site, I highly recommend Parse::MediaWikiDump - as it parses the XML dump files very fast, you don't even need an XML complete file. Scooter ----- "Alec Clews" wrote: > G'Day, > > I have some Media Wiki pages, laid out for the benefit of humans > (irregularly) , with tables of values. > > Does anyone have a recommendation on a suitable module to scrap the > some > of the values? I figured WWW::Mechanize, but I've never used it. > > Cheers > > -- > Alec Clews > Personal Melbourne, Australia. > Jabber: alecclews at jabber.org.au PGPKey ID: 0x9BBBFC7C > Blog http://alecthegeek.wordpress.com/ > > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm -- http://scott.dd.com.au/ scottp at dd.com.au From alfiejohn at gmail.com Tue Jan 12 20:01:46 2010 From: alfiejohn at gmail.com (Alfie John) Date: Wed, 13 Jan 2010 15:01:46 +1100 Subject: [Melbourne-pm] Scraping Media Wiki In-Reply-To: <844195963.530551263354542554.JavaMail.root@mail-4.01.com> References: <239501466.530501263354456573.JavaMail.root@mail-4.01.com> <844195963.530551263354542554.JavaMail.root@mail-4.01.com> Message-ID: On Wed, Jan 13, 2010 at 2:49 PM, wrote: > I think it is a three part answer: > > * WWW:Mechanize or even just LWP to get the page > * XML format may give you some benefits, such as Date modified > * Then parse the content there are a number of wiki text parsers on CPAN, > none of them great, but most ok. Converting to HTML may be your best bet, at > least then it is in HTML table format. > > There are some Mediawiki API classes too, but I have not used them: > > * WWW::Mediawiki::Client > * MediaWiki::API > I agree with WWW::Mechanize. But if you don't manage to get any of the wiki parsers going and your data is consistent, you could try Template::Extract. Alfie -------------- next part -------------- An HTML attachment was scrubbed... URL: From thogard at abnormal.com Tue Jan 12 20:53:50 2010 From: thogard at abnormal.com (Tim Hogard) Date: Wed, 13 Jan 2010 04:53:50 +0000 (UTC) Subject: [Melbourne-pm] SOCIAL MEET ONLY tonight (and that only maybe) In-Reply-To: <4B4D37EB.10403@gmail.com> Message-ID: <201001130453.o0D4roSj006607@v.abnormal.com> > > Jacinta Richardson wrote: > > Due to a lack of firm venue plans; there won't be a normal Melbourne PM meeting > > tonight. Alec looks eager to meet at Beer Deluxe and enjoy their wifi; other > > venues have been suggested. Stay tuned to any announcement from him for further > > details > > I am of course *only* interested in the free wifi. 6:30 onwards? I > suggest we stick with Beer Deluxe as we all know the location? Is that the place in Fed Square? If so I'll be there at 6:30. -tim From alec.clews at gmail.com Tue Jan 12 21:03:52 2010 From: alec.clews at gmail.com (Alec Clews) Date: Wed, 13 Jan 2010 16:03:52 +1100 Subject: [Melbourne-pm] SOCIAL MEET ONLY tonight (and that only maybe) In-Reply-To: <201001130453.o0D4roSj006607@v.abnormal.com> References: <201001130453.o0D4roSj006607@v.abnormal.com> Message-ID: <4B4D5438.4040807@gmail.com> Location is http://www.beerdeluxe.com.au/index.php So far 3 confirmed coming >> Jacinta Richardson wrote: >> >>> Due to a lack of firm venue plans; there won't be a normal Melbourne PM meeting >>> tonight. Alec looks eager to meet at Beer Deluxe and enjoy their wifi; other >>> venues have been suggested. Stay tuned to any announcement from him for further >>> details >>> >> I am of course *only* interested in the free wifi. 6:30 onwards? I >> suggest we stick with Beer Deluxe as we all know the location? >> -- Alec Clews Personal Melbourne, Australia. Jabber: alecclews at jabber.org.au PGPKey ID: 0x9BBBFC7C Blog http://alecthegeek.wordpress.com/ From toby.corkindale at strategicdata.com.au Tue Jan 12 21:07:39 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 13 Jan 2010 16:07:39 +1100 Subject: [Melbourne-pm] SOCIAL MEET ONLY tonight (and that only maybe) In-Reply-To: <4B4D5438.4040807@gmail.com> References: <201001130453.o0D4roSj006607@v.abnormal.com> <4B4D5438.4040807@gmail.com> Message-ID: <4B4D551B.2020404@strategicdata.com.au> On 13/01/10 16:03, Alec Clews wrote: > Location is http://www.beerdeluxe.com.au/index.php > > So far 3 confirmed coming *handwavey* me too. I'll do my lightning talk on Tesseract and FTS next month; might give me time to create some kind of neater demo.. although I am planning on ditching the KinoSearch stuff in favour of postgres' FTS; faster and simpler. Which is a pity, since the Moose code wrapping the KinoSearch was the nicer bit. But you're probably interested in knowing how to add full-text search to Postgres columns anyway, too? Toby From alfiejohn at gmail.com Tue Jan 12 21:45:20 2010 From: alfiejohn at gmail.com (Alfie John) Date: Wed, 13 Jan 2010 16:45:20 +1100 Subject: [Melbourne-pm] SOCIAL MEET ONLY tonight (and that only maybe) In-Reply-To: <4B4D551B.2020404@strategicdata.com.au> References: <201001130453.o0D4roSj006607@v.abnormal.com> <4B4D5438.4040807@gmail.com> <4B4D551B.2020404@strategicdata.com.au> Message-ID: Can't make it tonight, but hopefully will next month Alfie On Wed, Jan 13, 2010 at 4:07 PM, Toby Corkindale < toby.corkindale at strategicdata.com.au> wrote: > On 13/01/10 16:03, Alec Clews wrote: > >> Location is http://www.beerdeluxe.com.au/index.php >> >> So far 3 confirmed coming >> > > *handwavey* me too. > > I'll do my lightning talk on Tesseract and FTS next month; might give me > time to create some kind of neater demo.. although I am planning on ditching > the KinoSearch stuff in favour of postgres' FTS; faster and simpler. Which > is a pity, since the Moose code wrapping the KinoSearch was the nicer bit. > > But you're probably interested in knowing how to add full-text search to > Postgres columns anyway, too? > > Toby > > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scottp at dd.com.au Tue Jan 19 21:25:32 2010 From: scottp at dd.com.au (Scott Penrose) Date: Wed, 20 Jan 2010 16:25:32 +1100 Subject: [Melbourne-pm] Moose - complex validation Message-ID: <9B8FD6C5-5CF7-4EA9-97C0-C7F1CDD7D4EA@dd.com.au> Hey Team I have a complex moose validation, dependent on multiple inputs. e.g. package MyThing; use Moose; subtype 'Path' => as Str => where { -d $_ } => message { "Path provided must exist" }; subtype 'Command' => as Str, # XXX how to get root ? => where { -f "$root/$_" && -x "$root/$_" }, => message { "Command provided does not exist or is not executable " }; had 'root' => ( is => 'ro', isa => 'Path', default => '/usr/bin', ); has 'script' => ( is => 'ro', isa => 'Command', required => 1, ); Basically you would create the object my $o = MyThing->new( script => 'example', ); but you could override the default root for the scripts with: my $o = MyThing->new( script => 'example', root => '/usr/sbin', ); So... as you can see form the subtype 'Command' I am not sure how you can access the other parameter, and to define the validation order, as root would need to be done first. So... should it be done in a BUILD ? sub BUILD { my $self = shift; if (! -x $self->root . '/' . $self->script) { die "Help... script should exist in path and be executable..."; } } I.e. is 'subtype' only for primitives ? Scott From toby.corkindale at strategicdata.com.au Tue Jan 19 22:33:23 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 20 Jan 2010 17:33:23 +1100 Subject: [Melbourne-pm] Moose - complex validation In-Reply-To: <9B8FD6C5-5CF7-4EA9-97C0-C7F1CDD7D4EA@dd.com.au> References: <9B8FD6C5-5CF7-4EA9-97C0-C7F1CDD7D4EA@dd.com.au> Message-ID: <4B56A3B3.9000202@strategicdata.com.au> On 20/01/10 16:25, Scott Penrose wrote: > Hey Team > > I have a complex moose validation, dependent on multiple inputs. > > e.g. > > package MyThing; > use Moose; > > subtype 'Path' > => as Str > => where { -d $_ } > => message { "Path provided must exist" }; > > subtype 'Command' > => as Str, > # XXX how to get root ? > => where { -f "$root/$_"&& -x "$root/$_" }, > => message { "Command provided does not exist or is not executable " }; > > had 'root' => ( > is => 'ro', > isa => 'Path', > default => '/usr/bin', > ); > > has 'script' => ( > is => 'ro', > isa => 'Command', > required => 1, > ); > > Basically you would create the object > > my $o = MyThing->new( > script => 'example', > ); > > but you could override the default root for the scripts with: > > my $o = MyThing->new( > script => 'example', > root => '/usr/sbin', > ); > > So... as you can see form the subtype 'Command' I am not sure how you can access the other parameter, and to define the validation order, as root would need to be done first. > > So... should it be done in a BUILD ? > > sub BUILD { > my $self = shift; > if (! -x $self->root . '/' . $self->script) { > die "Help... script should exist in path and be executable..."; > } > } > > I.e. is 'subtype' only for primitives ? Hmm, it'll be hard to tell which order attributes are initialised, set, and checked in. ie. Even if you could get $self->root in the check method of script, then how do you know if it'd be checked before ->root was set with the /usr/sbin/ value rather than the default? I'd go with doing the validation at another point in the code, I think, such as in the BUILD method, as you said. I'm not a Moose guru though; there may be better ways. Toby From Martin.G.Ryan at team.telstra.com Tue Jan 19 23:09:17 2010 From: Martin.G.Ryan at team.telstra.com (Ryan, Martin G) Date: Wed, 20 Jan 2010 18:09:17 +1100 Subject: [Melbourne-pm] Moose - complex validation In-Reply-To: <9B8FD6C5-5CF7-4EA9-97C0-C7F1CDD7D4EA@dd.com.au> References: <9B8FD6C5-5CF7-4EA9-97C0-C7F1CDD7D4EA@dd.com.au> Message-ID: <589EE331794E0B4DA62A9ADE89BCB4057CC107AFAB@WSMSG3103V.srv.dir.telstra.com> Hi Scott ! [ Warning: I don't know Moose for any reasonable definition of "know". I've just been reading a lot about it lately and can't resist a stab. Sorry for using your genuine predicament as a testing toy ] > I have a complex moose validation, dependent on multiple inputs. > subtype 'Command' > => as Str, > # XXX how to get root ? > => where { -f "$root/$_" && -x "$root/$_" }, > => message { "Command provided does not exist or is not executable " }; > has 'script' => ( > is => 'ro', > isa => 'Command', > required => 1, > ); It seems to me that subtypes are more for declaring "reduced domain types". If you can't innately define whether a value is part of your type - i.e. using nothing other than the value itself - then subtypes is the wrong place for it. In your case, if I supply you "rebootWithMalice" as a script value, you cant tell me if it passes muster as a member of the "Command" subtype without interrogating the perfectly innocent, by-standing, "root" attribute. You really want to do a validation of your script attribute but only after the root attribute has been set (or declined to be set in favour of a default). Looking at Moose::Manual::Attribute under "Default and builder methods", it covers using a sub as a default value or declaring a "builder" routine but its all aimed at bringing the value into existence from nothing rather than validating what's supplied. Looking at Moose::Manual::Construction ... == snip == The "BUILD" method is called after an object is created. There are several ways to use a "BUILD" method. One of the most common is to check that the object state is valid. While we can validate individual attributes through the use of types, we can't validate the state of a whole object that way. == snip == As you already alluded to, I think this is what you're really doing. Your validating one attribute but its validity is dependant on another so, we're really talking about validating the thing as a whole. Your other alternatives AFAICT, is BUILDARGS where you can do the checks on the parameter list as supplied but as the object is not created yet, you want have that default for root available to you; and using a trigger which seems to me more aimed at attributes who's value change during the life of the object and need to be revalidated (presumably your only after the one-time validation at creation time). So, if your question is "does BUILD seem the right place?", it would have my vote, FWIW. Martin -----Original Message----- From: melbourne-pm-bounces+martin.g.ryan=team.telstra.com at pm.org [mailto:melbourne-pm-bounces+martin.g.ryan=team.telstra.com at pm.org] On Behalf Of Scott Penrose Sent: Wednesday, 20 January 2010 4:26 PM To: Melbourne Perlmongers Subject: [Melbourne-pm] Moose - complex validation Hey Team I have a complex moose validation, dependent on multiple inputs. e.g. package MyThing; use Moose; subtype 'Path' => as Str => where { -d $_ } => message { "Path provided must exist" }; subtype 'Command' => as Str, # XXX how to get root ? => where { -f "$root/$_" && -x "$root/$_" }, => message { "Command provided does not exist or is not executable " }; had 'root' => ( is => 'ro', isa => 'Path', default => '/usr/bin', ); has 'script' => ( is => 'ro', isa => 'Command', required => 1, ); Basically you would create the object my $o = MyThing->new( script => 'example', ); but you could override the default root for the scripts with: my $o = MyThing->new( script => 'example', root => '/usr/sbin', ); So... as you can see form the subtype 'Command' I am not sure how you can access the other parameter, and to define the validation order, as root would need to be done first. So... should it be done in a BUILD ? sub BUILD { my $self = shift; if (! -x $self->root . '/' . $self->script) { die "Help... script should exist in path and be executable..."; } } I.e. is 'subtype' only for primitives ? Scott _______________________________________________ Melbourne-pm mailing list Melbourne-pm at pm.org http://mail.pm.org/mailman/listinfo/melbourne-pm From scottp at dd.com.au Wed Jan 20 03:03:45 2010 From: scottp at dd.com.au (Scott Penrose) Date: Wed, 20 Jan 2010 22:03:45 +1100 Subject: [Melbourne-pm] Moose - complex validation In-Reply-To: <589EE331794E0B4DA62A9ADE89BCB4057CC107AFAB@WSMSG3103V.srv.dir.telstra.com> References: <9B8FD6C5-5CF7-4EA9-97C0-C7F1CDD7D4EA@dd.com.au> <589EE331794E0B4DA62A9ADE89BCB4057CC107AFAB@WSMSG3103V.srv.dir.telstra.com> Message-ID: <214D84D6-9D91-4A05-B3A3-B341C34B0377@dd.com.au> On 20/01/2010, at 6:09 PM, Ryan, Martin G wrote: > == snip == > The "BUILD" method is called after an object is created. > There are several ways to use a "BUILD" method. One of the > most common is to check that the object state is valid. > While we can validate individual attributes through the use > of types, we can't validate the state of a whole object that > way. > == snip == You're the man. I was looking for something like that. So I guessed right, but now I know :-) Ta Scooter From kim at hawtin.net.au Wed Jan 20 20:56:09 2010 From: kim at hawtin.net.au (Kim Hawtin) Date: Thu, 21 Jan 2010 15:26:09 +1030 Subject: [Melbourne-pm] OT: Adelaide Perl Mongers first social meet Message-ID: <4B57DE69.1000007@hawtin.net.au> Evening all, Adelaide Perl Mongers kicks off the first social meeting. when: Friday, 22nd January time: 5.30pm - until we head off for food where: The beer garden out the back at The Exeter Hotel, 246 Rundle St, Adelaide internet: internode wifi topics: * Drinks * Food * Perl more details and map: http://adelaide.pm.org/ So if you're in Adelaide with nothing to do, come along for a drink with us =) Please shoot me an email if you need more info or directions. regards, Kim From gma at talentscoutbang.com Thu Jan 21 18:36:28 2010 From: gma at talentscoutbang.com (Gregory McCallum Anderson) Date: Fri, 22 Jan 2010 13:36:28 +1100 Subject: [Melbourne-pm] Perl Programmer role - permanent circa $75, 000 in Essendon Message-ID: <0383F7E9-EF4F-4567-913F-85290648143D@talentscoutbang.com> Are you looking for a new Perl role in 2010? I am looking for a Developer for a permanent mid-level role ? circa $75 k based in Essendon. We need someone who is very comfortable with programming in a Unix/Linux environment, using CPAN and embedded sql. This is not a web/html job, instead the primary focus will be on software development in a high functioning team of developers, working on enterprise core systems. This is a Mon- Frid 9-5 role in a professional but relaxed environment. The key skills: Database Objects Design experience. Design and implementation of Stored Procedures, Triggers and Views, Perl Programming, Unix/Linux Programming, Firebird/Interbase/PostGRES Databases experience, Embedded SQL Programming, HTML, PHP, CSS, JavaScript, Python? If you are interested and would like to know more you can call me directly to discuss: Greg Anderson, CEO [ta!ent scout] 0425 861 012 or email me: gma at talentscoutbang.com From jarich at perltraining.com.au Sun Jan 24 19:47:06 2010 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Mon, 25 Jan 2010 14:47:06 +1100 Subject: [Melbourne-pm] Venue for February meeting - 10th Feb (and OSDClub) Message-ID: <4B5D143A.1050505@perltraining.com.au> G'day folk, In two and a bit week's time Melbourne Perl Mongers will host the first Open Source Developers' Club meeting for 2010. In theory. At the moment I am not sure of what venue this awesome event will take place. I'm sure I can find speakers. I'm about to head off overseas for another 2 weeks, and won't arrive back until 8th Feb. I hope to have frequent access to email, over that time, but I\ll also be busy. We need to find a venue for the next meeting, and ideally for the rest of this years' meetings. Can you help me? J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From scottp at dd.com.au Sun Jan 24 19:51:45 2010 From: scottp at dd.com.au (Scott Penrose) Date: Mon, 25 Jan 2010 14:51:45 +1100 Subject: [Melbourne-pm] Venue for February meeting - 10th Feb (and OSDClub) In-Reply-To: <4B5D143A.1050505@perltraining.com.au> References: <4B5D143A.1050505@perltraining.com.au> Message-ID: Talks? I would be happy to repeat my OSDC2009 talk on ExtJS and OpenLayers if people are interested. Scott On 25/01/2010, at 2:47 PM, Jacinta Richardson wrote: > G'day folk, > > In two and a bit week's time Melbourne Perl Mongers will host the first Open > Source Developers' Club meeting for 2010. In theory. At the moment I am not > sure of what venue this awesome event will take place. I'm sure I can find > speakers. > > I'm about to head off overseas for another 2 weeks, and won't arrive back until > 8th Feb. I hope to have frequent access to email, over that time, but I\ll also > be busy. We need to find a venue for the next meeting, and ideally for the rest > of this years' meetings. > > Can you help me? > > J > > -- > ("`-''-/").___..--''"`-._ | Jacinta Richardson | > `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | > (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | > _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | > (il),-'' (li),' ((!.-' | www.perltraining.com.au | > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm From greg.george at orica.com Tue Jan 26 21:56:12 2010 From: greg.george at orica.com (greg.george at orica.com) Date: Wed, 27 Jan 2010 16:56:12 +1100 Subject: [Melbourne-pm] Venue for February meeting - More than happy to here Scott's talk. In-Reply-To: Message-ID: I would be happy listen to Scott's OSDC2009 talk on ExtJS and OpenLayers as I am interested. Regards, Greg George IT Shared Services Phone: +613-9091-2492 3/100 Victoria Prd, Melbourne Please consider the environment before printing this e-mail *********************************************************************************************************************************************************************************************** Please consider the environment before printing this e-mail. This message is intended solely for the individual(s) and entity(s) addressed. It is confidential and may contain legally privileged information. The use, copying or distribution of this message or any information it contains, by anyone other than the addressee, is prohibited. If you have received this message in error, please notify postmaster at orica.com. The mailbox address from which this message has been sent is for business mail only. Mail sent to it may be subject to security scanning and delivery on non-business messages sent to this address may not occur. Thank you. *********************************************************************************************************************************************************************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From jarich at perltraining.com.au Wed Jan 27 02:17:25 2010 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Wed, 27 Jan 2010 21:17:25 +1100 Subject: [Melbourne-pm] Venue for February meeting - More than happy to here Scott's talk. In-Reply-To: References: Message-ID: <4B6012B5.7040401@perltraining.com.au> greg.george at orica.com wrote: > > I would be happy listen to Scott's OSDC2009 talk on ExtJS and OpenLayers > as I am interested. I'm delighted to see eagerness for both hearing and giving talks. The primary problem of finding a venue remains. Does anyone work in a place which has a boardroom we could borrow even just for this next meeting (although into the future would be even more awesome)? If I don't hear of a location by Monday (1st), I'll ask the PHP group to host OSDClub this month, or we'll run it in March or something... Those with contacts at places like Horse Bazaar and/or Loop Bar (or any similar place with a projector and seats) are encouraged to talk to those contacts and see what it would take for us to use that venue. Free would be awesome, but a small nominal cost might be acceptable as well. Thanks again. All the best, J -- ("`-''-/").___..--''"`-._ | Jacinta Richardson | `6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia | (_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 | _..`--'_..-_/ /--'_.' ,' | contact at perltraining.com.au | (il),-'' (li),' ((!.-' | www.perltraining.com.au | From hamish at hamishcarpenter.com Thu Jan 28 20:38:33 2010 From: hamish at hamishcarpenter.com (Hamish Carpenter) Date: Fri, 29 Jan 2010 15:38:33 +1100 Subject: [Melbourne-pm] Venue for February meeting - More than happy to here Scott's talk. In-Reply-To: <4B6012B5.7040401@perltraining.com.au> References: <4B6012B5.7040401@perltraining.com.au> Message-ID: <2d53e4cf1001282038v40d6abd8v6aaf8a5992ff04f1@mail.gmail.com> On Wed, Jan 27, 2010 at 9:17 PM, Jacinta Richardson wrote: > Does anyone work in a place which has a boardroom we could borrow even just for this next meeting (although into the future would be even more awesome)? I am able to offer the boardroom at work for the next meeting. It has seating for around 25 people and a projector. It is located in the CBD near the corner of Flinders and Queen street. We are unable to offer internet for laptops although I will have my work laptop which is connected. cheers, Hamish From jarich at perltraining.com.au Sun Jan 31 23:04:19 2010 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Mon, 01 Feb 2010 15:04:19 +0800 Subject: [Melbourne-pm] Next OSDClub/Melbourne Perl Monger meeting: 10th February 2010 Message-ID: <4B667CF3.60707@perltraining.com.au> G'day folk, The Open Source Developers' Club is a group designed to bring Melbourne's great developer community together, regardless of whether they write code in Perl, Python, PHP, Ruby or something else. Talks are designed to share information about things which are meta issues to our programming; such as database interactions, javascript testing tools, tricks of our trade etc. It is hosted every two months and shared between the Melbourne Perl Mongers group and the Melbourne PHP Programmers. Cheryl Davis from EvoStor has kindly arranged for us to use their premises for the next meeting. EvoStor is a technology start-up developing storage systems specifically designed to meet the challenges of storage for virtual infrastructure. All of the engineering work is done out of Melbourne with the corporate headquarters in California. So a huge thank you to Cheryl and EvoStor! Please join us at 6:30pm at: Level 10, 350 Collins Street, Melbourne (EvoStor side of the floor) The doors will be locked, but I will be there to help let you in. If you are running late, please look out for the note with the phone number you should ring to be let in. Talks should start at about 6:45pm. Talks: -------- Scott Penrose: ExtJS and OpenLayers (30 minutes) Patrick Donelan: Tricking People Into Thinking Your Website is Fast: WebGUI and YSlow, 100 or bust! (30 minutes) Suggestions for food places after the meeting are welcome.