From toby.corkindale at strategicdata.com.au Mon Oct 3 19:59:43 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Tue, 04 Oct 2011 13:59:43 +1100 Subject: [Melbourne-pm] October Melbourne Perlmongers meeting In-Reply-To: References: <4E840C75.6060001@strategicdata.com.au> Message-ID: <4E8A769F.4050809@strategicdata.com.au> On 29/09/11 20:32, Myf White wrote: > Hi Toby & everyone, > > I heard a rumour (maybe from a previous email?) that there was gonna be > a talk on Selenium + Perl and had been looking forward to it. Is this on > the cards at all? > Hi Myf, Not looking likely for the upcoming meeting, but I'm still hoping to have this talk presented to the Perlmongers, one way or another, soon. Toby From toby.corkindale at strategicdata.com.au Tue Oct 4 22:34:28 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 05 Oct 2011 16:34:28 +1100 Subject: [Melbourne-pm] Nested maps returning hash references Message-ID: <4E8BEC64.4060504@strategicdata.com.au> OK, this is doing my head in. I have two map functions that work perfectly well on their own: map { $f->can($_) ? ($_ => $f->$_) : () } qw (label name html); map { { label => $f->label, name => $f->name, html => $f->html, } } @fields; However when I combine them, it all goes pear-shaped, and I just get back one huge, flat array, rather than an array of hashes. map { my $f = $_; { map { $f->can($_) ? ($_ => $f->$_) : () } qw(label name html); } } @fields; Any thoughts? Cheers, Toby From toby.corkindale at strategicdata.com.au Tue Oct 4 22:43:43 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 05 Oct 2011 16:43:43 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BEC64.4060504@strategicdata.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> Message-ID: <4E8BEE8F.8000709@strategicdata.com.au> It's worth noting that the following *does* work.. It's just uglier :( map { my $f = $_; my $perlsucks = { map { $f->can($_) ? ($_ => $f->$_) : () } qw(label name html) }; $perlsucks } @fields; On 05/10/11 16:34, Toby Corkindale wrote: > OK, this is doing my head in. > > I have two map functions that work perfectly well on their own: > > map { > $f->can($_) ? ($_ => $f->$_) : () > } qw (label name html); > > map { > { > label => $f->label, > name => $f->name, > html => $f->html, > } > } @fields; > > > However when I combine them, it all goes pear-shaped, and I just get > back one huge, flat array, rather than an array of hashes. > > map { > my $f = $_; > { > map { > $f->can($_) ? ($_ => $f->$_) : () > } qw(label name html); > } > } @fields; > > > Any thoughts? > > Cheers, > Toby > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm -- .signature From toby.corkindale at strategicdata.com.au Tue Oct 4 22:44:51 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 05 Oct 2011 16:44:51 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BEE20.1060603@strategicdata.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEE20.1060603@strategicdata.com.au> Message-ID: <4E8BEED3.1040800@strategicdata.com.au> On 05/10/11 16:41, Andrew Pam wrote: > On 05/10/11 16:34, Toby Corkindale wrote: >> OK, this is doing my head in. >> >> I have two map functions that work perfectly well on their own: >> >> map { >> $f->can($_) ? ($_ => $f->$_) : () >> } qw (label name html); >> >> map { >> { >> label => $f->label, >> name => $f->name, >> html => $f->html, >> } >> } @fields; >> >> >> However when I combine them, it all goes pear-shaped, and I just get >> back one huge, flat array, rather than an array of hashes. >> >> map { >> my $f = $_; >> { >> map { >> $f->can($_) ? ($_ => $f->$_) : () >> } qw(label name html); >> } >> } @fields; >> >> >> Any thoughts? > > You'll probably need to "local $_", but it's recommended that you make > the inner map into a function and call it from the outer map for > readability. Cheers Andrew, you're right, it'll probably be more readable and better code AND work right if I go down the subroutine method. ta, Toby From andrew at sericyb.com.au Tue Oct 4 22:46:28 2011 From: andrew at sericyb.com.au (Andrew Pam) Date: Wed, 05 Oct 2011 16:46:28 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BEC64.4060504@strategicdata.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> Message-ID: <4E8BEF34.3050700@sericyb.com.au> On 05/10/11 16:34, Toby Corkindale wrote: > OK, this is doing my head in. > > I have two map functions that work perfectly well on their own: > > map { > $f->can($_) ? ($_ => $f->$_) : () > } qw (label name html); > > map { > { > label => $f->label, > name => $f->name, > html => $f->html, > } > } @fields; > > > However when I combine them, it all goes pear-shaped, and I just get > back one huge, flat array, rather than an array of hashes. > > map { > my $f = $_; > { > map { > $f->can($_) ? ($_ => $f->$_) : () > } qw(label name html); > } > } @fields; > > > Any thoughts? Actually looking more closely, the braces around the inner map in the final example look like they're being interpreted as a block, not as an anonymous hash constructor. Hope that helps, Andrew -- Andrew Pam Serious Cybernetics From andrew at sericyb.com.au Tue Oct 4 22:51:50 2011 From: andrew at sericyb.com.au (Andrew Pam) Date: Wed, 05 Oct 2011 16:51:50 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BEF34.3050700@sericyb.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> Message-ID: <4E8BF076.1010609@sericyb.com.au> On 05/10/11 16:46, Andrew Pam wrote: >> map { >> my $f = $_; >> { >> map { >> $f->can($_) ? ($_ => $f->$_) : () >> } qw(label name html); >> } >> } @fields; >> >> >> Any thoughts? > > Actually looking more closely, the braces around the inner map in the > final example look like they're being interpreted as a block, not as an > anonymous hash constructor. Note: Putting a unary "+" in front of the open bracket should turn it into an unambiguous hash constructor. Hope that helps, Andrew -- Andrew Pam Serious Cybernetics From toby.corkindale at strategicdata.com.au Tue Oct 4 22:52:49 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 05 Oct 2011 16:52:49 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BF076.1010609@sericyb.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> Message-ID: <4E8BF0B1.3060809@strategicdata.com.au> On 05/10/11 16:51, Andrew Pam wrote: > On 05/10/11 16:46, Andrew Pam wrote: >>> map { >>> my $f = $_; >>> { >>> map { >>> $f->can($_) ? ($_ => $f->$_) : () >>> } qw(label name html); >>> } >>> } @fields; >>> >>> >>> Any thoughts? >> >> Actually looking more closely, the braces around the inner map in the >> final example look like they're being interpreted as a block, not as an >> anonymous hash constructor. > > Note: Putting a unary "+" in front of the open bracket should turn it > into an unambiguous hash constructor. That was one of the first things I tried after reading the map function's documentation - it doesn't work - not valid syntax. From andrew at sericyb.com.au Tue Oct 4 22:53:33 2011 From: andrew at sericyb.com.au (Andrew Pam) Date: Wed, 05 Oct 2011 16:53:33 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BF0B1.3060809@strategicdata.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> Message-ID: <4E8BF0DD.4010406@sericyb.com.au> On 05/10/11 16:52, Toby Corkindale wrote: > That was one of the first things I tried after reading the map > function's documentation - it doesn't work - not valid syntax. Haha - OK how about using "return" (is that valid inside a map?) Andrew -- Andrew Pam Serious Cybernetics From toby.corkindale at strategicdata.com.au Tue Oct 4 22:57:38 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 05 Oct 2011 16:57:38 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BF0DD.4010406@sericyb.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> Message-ID: <4E8BF1D2.2000302@strategicdata.com.au> On 05/10/11 16:53, Andrew Pam wrote: > On 05/10/11 16:52, Toby Corkindale wrote: >> That was one of the first things I tried after reading the map >> function's documentation - it doesn't work - not valid syntax. > > Haha - OK how about using "return" (is that valid inside a map?) Nope, tried that unsuccessfully too. From andrew at sericyb.com.au Tue Oct 4 23:01:09 2011 From: andrew at sericyb.com.au (Andrew Pam) Date: Wed, 05 Oct 2011 17:01:09 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BF1D2.2000302@strategicdata.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> Message-ID: <4E8BF2A5.1060603@sericyb.com.au> On 05/10/11 16:57, Toby Corkindale wrote: > On 05/10/11 16:53, Andrew Pam wrote: >> On 05/10/11 16:52, Toby Corkindale wrote: >>> That was one of the first things I tried after reading the map >>> function's documentation - it doesn't work - not valid syntax. >> >> Haha - OK how about using "return" (is that valid inside a map?) > > Nope, tried that unsuccessfully too. How about "my $hash = {...}" The result of the assignment should be returned as the last thing evaluated. Of course it's still more maintainable to have the outer map just call a function. Hope that helps, Andrew -- Andrew Pam Serious Cybernetics From alfiejohn at gmail.com Tue Oct 4 23:34:53 2011 From: alfiejohn at gmail.com (Alfie John) Date: Wed, 5 Oct 2011 17:34:53 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BF2A5.1060603@sericyb.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> <4E8BF2A5.1060603@sericyb.com.au> Message-ID: Hey Toby, I think there are two problems here: - Andrew was right. Put a + in front of the block - can($_) in the second block is being called on the qw{} and not on an object Alfie On Wed, Oct 5, 2011 at 5:01 PM, Andrew Pam wrote: > On 05/10/11 16:57, Toby Corkindale wrote: > > On 05/10/11 16:53, Andrew Pam wrote: > >> On 05/10/11 16:52, Toby Corkindale wrote: > >>> That was one of the first things I tried after reading the map > >>> function's documentation - it doesn't work - not valid syntax. > >> > >> Haha - OK how about using "return" (is that valid inside a map?) > > > > Nope, tried that unsuccessfully too. > > How about "my $hash = {...}" > > The result of the assignment should be returned as the last thing > evaluated. > > Of course it's still more maintainable to have the outer map just call a > function. > > Hope that helps, > Andrew > -- > Andrew Pam > Serious Cybernetics > _______________________________________________ > 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 alfiejohn at gmail.com Tue Oct 4 23:38:47 2011 From: alfiejohn at gmail.com (Alfie John) Date: Wed, 5 Oct 2011 17:38:47 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> <4E8BF2A5.1060603@sericyb.com.au> Message-ID: Whoops. That qw{} was in my test code. I added the + on the block and it worked for me. Alfie On Wed, Oct 5, 2011 at 5:34 PM, Alfie John wrote: > Hey Toby, > > I think there are two problems here: > > - Andrew was right. Put a + in front of the block > - can($_) in the second block is being called on the qw{} and not on an > object > > Alfie > > On Wed, Oct 5, 2011 at 5:01 PM, Andrew Pam wrote: > >> On 05/10/11 16:57, Toby Corkindale wrote: >> > On 05/10/11 16:53, Andrew Pam wrote: >> >> On 05/10/11 16:52, Toby Corkindale wrote: >> >>> That was one of the first things I tried after reading the map >> >>> function's documentation - it doesn't work - not valid syntax. >> >> >> >> Haha - OK how about using "return" (is that valid inside a map?) >> > >> > Nope, tried that unsuccessfully too. >> >> How about "my $hash = {...}" >> >> The result of the assignment should be returned as the last thing >> evaluated. >> >> Of course it's still more maintainable to have the outer map just call a >> function. >> >> Hope that helps, >> Andrew >> -- >> Andrew Pam >> Serious Cybernetics >> _______________________________________________ >> 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 Oct 4 23:42:56 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 05 Oct 2011 17:42:56 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> <4E8BF2A5.1060603@sericyb.com.au> Message-ID: <4E8BFC70.6070004@strategicdata.com.au> On 05/10/11 17:34, Alfie John wrote: > Hey Toby, > > I think there are two problems here: > > - Andrew was right. Put a + in front of the block > - can($_) in the second block is being called on the qw{} and not on > an object In case people want working test code, here is some below. By the way, I was trying to put the + on line 11 below, to no success, but perhaps you mean a different {? (I'm picking the, umm, third that occurs in the whole program, or second within the map..) #!/usr/bin/env perl use 5.14.1; use warnings; use Data::Dumper; my @fields = map { Foo->new($_) } qw(bing bang bong); my $foo = [ map { my $f = $_; { map { $f->can($_) ? ($_ => $f->$_) : () } qw(label name html); } } @fields ]; say Dumper($foo); package Foo; sub label { shift->{label} } sub new { bless { label => $_[1] } } 1; From toby.corkindale at strategicdata.com.au Tue Oct 4 23:44:16 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 05 Oct 2011 17:44:16 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> <4E8BF2A5.1060603@sericyb.com.au> Message-ID: <4E8BFCC0.8020901@strategicdata.com.au> On 05/10/11 17:38, Alfie John wrote: > Whoops. That qw{} was in my test code. > > I added the + on the block and it worked for me. That is weird; I tried prefixing a + symbol to both the left-hand-curly-braces in the maps (one at a time), to no avail! This is Perl 5.14.1.. From myfwhite at gmail.com Wed Oct 5 00:24:24 2011 From: myfwhite at gmail.com (Myf White) Date: Wed, 5 Oct 2011 18:24:24 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BFC70.6070004@strategicdata.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> <4E8BF2A5.1060603@sericyb.com.au> <4E8BFC70.6070004@strategicdata.com.au> Message-ID: On Wed, Oct 5, 2011 at 5:42 PM, Toby Corkindale < toby.corkindale at strategicdata.com.au> wrote: > On 05/10/11 17:34, Alfie John wrote: > >> Hey Toby, >> >> I think there are two problems here: >> >> - Andrew was right. Put a + in front of the block >> - can($_) in the second block is being called on the qw{} and not on >> an object >> > > In case people want working test code, here is some below. > By the way, I was trying to put the + on line 11 below, to no success, but > perhaps you mean a different {? > (I'm picking the, umm, third that occurs in the whole program, or second > within the map..) > > > #!/usr/bin/env perl > use 5.14.1; > use warnings; > use Data::Dumper; > > my @fields = map { Foo->new($_) } qw(bing bang bong); > > my $foo = [ > > map { > my $f = $_; > { > map { > $f->can($_) ? ($_ => $f->$_) : () > } qw(label name html); > } > } @fields > ]; > > say Dumper($foo); > > package Foo; > > sub label { shift->{label} } > > sub new { bless { label => $_[1] } } > > 1; > > On 5.10.1 that didn't work for me. I tried it with adding a local variable for the hashref inside the first map, which seemed to do what I think you're trying to do my $array_ref = [map { my $f = $_; my $inner = { map { $f->can($_) ? ( $_ => $f->$_ ) : (); } qw/label name html/ }; $inner; } @fields]; I would be careful putting subroutine calls inside maps that are being used for hashes though, because the returns from $f->label, $f->name, $f->html can only ever be a single value. If someone decides to change what gets returned, you could end up with "odd number of elements" errors. I do it pretty commonly, but only if I'm confident the testing around it is decent. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alfiejohn at gmail.com Wed Oct 5 01:24:15 2011 From: alfiejohn at gmail.com (Alfie John) Date: Wed, 5 Oct 2011 19:24:15 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BFCC0.8020901@strategicdata.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> <4E8BF2A5.1060603@sericyb.com.au> <4E8BFCC0.8020901@strategicdata.com.au> Message-ID: Sorry... read my email during dinner. Here is what I did as a test: #!/usr/bin/perl; use warnings; use strict; package Foo; use base 'Class::Accessor'; my @fields = qw{ label name html }; Foo->mk_accessors( @fields ); sub new { my $self = bless {}, $_[0]; foreach my $field ( @fields ) { $self->$field( $field ); } return $self; } my @foos = map { Foo->new() } 1..3; use Data::Dumper; warn Dumper([ map { my $f = $_; { map { $f->can($_) ? ( $_ => $f->$_() ) : () } @fields } } @foos ]); It looks essentially the same as what you were running. This should output: $VAR1 = [ { 'html' => 'html', 'name' => 'name', 'label' => 'label' }, { 'html' => 'html', 'name' => 'name', 'label' => 'label' }, { 'html' => 'html', 'name' => 'name', 'label' => 'label' } ]; Take out the + and you get: $VAR1 = [ 'label', 'label', 'name', 'name', 'html', 'html', 'label', 'label', 'name', 'name', 'html', 'html', 'label', 'label', 'name', 'name', 'html', 'html' ]; After looking at yours, it looks like the problem was the trailing semi colon after the qw[} :) Alfie On Wed, Oct 5, 2011 at 5:44 PM, Toby Corkindale wrote: > > On 05/10/11 17:38, Alfie John wrote: >> >> Whoops. That qw{} was in my test code. >> >> I added the + on the block and it worked for me. > > That is weird; I tried prefixing a + symbol to both the left-hand-curly-braces in the maps (one at a time), to no avail! > > This is Perl 5.14.1.. From alfiejohn at gmail.com Wed Oct 5 01:42:49 2011 From: alfiejohn at gmail.com (Alfie John) Date: Wed, 5 Oct 2011 19:42:49 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> <4E8BF2A5.1060603@sericyb.com.au> <4E8BFCC0.8020901@strategicdata.com.au> Message-ID: Also, you could have reduced it down by returning a hashref on the truth side of the ternary: map { my $f = $_; map { $f->can($_) ? { $_ => $f->$_ } : () } qw( label name html ) } @fields It's a shame you can't access hidden scopes and you need to create a temporary variable like $f here. Maybe Perl needs a way of accessing outer block values e.g.: map { map { $_^->can($_) ? { $_ => $_^->$_ } : () } } @fields The $_^ is $_ but one level higher (e.g. git's HEAD^ vs HEAD). But since having multiple levels would look ugly (e.g. $_^^^ for 3 levels out, maybe we also need a postfix operator like $_@ which is an array containing the all of the $_ values for each level: $_@ = ( $_, $_^, $_^^, $_^^^ ); But this wouldn't just be for $_, it would work on all variables. That way, when you local a variable, you can still access the hidden values too. Perl already stores their values. Thoughts? Alfie On Wed, Oct 5, 2011 at 7:24 PM, Alfie John wrote: > Sorry... read my email during dinner. > > Here is what I did as a test: > > ?#!/usr/bin/perl; > > ?use warnings; > ?use strict; > > ?package Foo; > > ?use base 'Class::Accessor'; > > ?my @fields = qw{ label name html }; > ?Foo->mk_accessors( @fields ); > > ?sub new { > ? ?my $self = bless {}, $_[0]; > > ? ?foreach my $field ( @fields ) { > ? ? ? ? ? ?$self->$field( $field ); > ? ?} > > ? ?return $self; > ?} > > ?my @foos = map { Foo->new() } 1..3; > > ?use Data::Dumper; warn Dumper([ > ? ? ? ? ?map { > ? ? ? ? ? ? ? ? ?my $f = $_; > ? ? ? ? ? ? ? ? ?{ > ? ? ? ? ? ? ? ? ? ? ? ? ?map { > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?$f->can($_) ? ( $_ => $f->$_() ) : () > ? ? ? ? ? ? ? ? ? ? ? ? ?} @fields > ? ? ? ? ? ? ? ? ?} > ? ? ? ? ?} @foos > ?]); > > It looks essentially the same as what you were running. This should output: > > $VAR1 = [ > ? ? ? ? ?{ > ? ? ? ? ? ?'html' => 'html', > ? ? ? ? ? ?'name' => 'name', > ? ? ? ? ? ?'label' => 'label' > ? ? ? ? ?}, > ? ? ? ? ?{ > ? ? ? ? ? ?'html' => 'html', > ? ? ? ? ? ?'name' => 'name', > ? ? ? ? ? ?'label' => 'label' > ? ? ? ? ?}, > ? ? ? ? ?{ > ? ? ? ? ? ?'html' => 'html', > ? ? ? ? ? ?'name' => 'name', > ? ? ? ? ? ?'label' => 'label' > ? ? ? ? ?} > ? ? ? ?]; > > Take out the + and you get: > > $VAR1 = [ > ? ? ? ? ?'label', > ? ? ? ? ?'label', > ? ? ? ? ?'name', > ? ? ? ? ?'name', > ? ? ? ? ?'html', > ? ? ? ? ?'html', > ? ? ? ? ?'label', > ? ? ? ? ?'label', > ? ? ? ? ?'name', > ? ? ? ? ?'name', > ? ? ? ? ?'html', > ? ? ? ? ?'html', > ? ? ? ? ?'label', > ? ? ? ? ?'label', > ? ? ? ? ?'name', > ? ? ? ? ?'name', > ? ? ? ? ?'html', > ? ? ? ? ?'html' > ? ? ? ?]; > > After looking at yours, it looks like the problem was the trailing > semi colon after the qw[} :) > > Alfie > > On Wed, Oct 5, 2011 at 5:44 PM, Toby Corkindale > wrote: >> >> On 05/10/11 17:38, Alfie John wrote: >>> >>> Whoops. That qw{} was in my test code. >>> >>> I added the + on the block and it worked for me. >> >> That is weird; I tried prefixing a + symbol to both the left-hand-curly-braces in the maps (one at a time), to no avail! >> >> This is Perl 5.14.1.. > From rjenkins at rjj.id.au Wed Oct 5 03:02:52 2011 From: rjenkins at rjj.id.au (Russell Jenkins) Date: Wed, 05 Oct 2011 21:02:52 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: <4E8BFC70.6070004@strategicdata.com.au> References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> <4E8BF2A5.1060603@sericyb.com.au> <4E8BFC70.6070004@strategicdata.com.au> Message-ID: <4E8C2B4C.3000700@rjj.id.au> On 5/10/11 5:42 PM, Toby Corkindale wrote: > On 05/10/11 17:34, Alfie John wrote: >> - Andrew was right. Put a + in front of the block > In case people want working test code, here is some below. > By the way, I was trying to put the + on line 11 below, to no success, > but perhaps you mean a different {? > (I'm picking the, umm, third that occurs in the whole program, or > second within the map..) Hmmm, I think you need that unary + in front of the second '{' in your code. i.e. ... +{ map { $f->can($_) ? ... } qw(label name html) } At a quick guess, without flagging that this is an anon hashref, perl is treating this as a block, hence the 'flattened' output. (Hope I'm not too sleep deprived to be on the right track..) Cheers, Russell. From myfwhite at gmail.com Wed Oct 5 03:03:48 2011 From: myfwhite at gmail.com (Myf White) Date: Wed, 5 Oct 2011 21:03:48 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> <4E8BF2A5.1060603@sericyb.com.au> <4E8BFCC0.8020901@strategicdata.com.au> Message-ID: Alfie, The + was missing in your previous email. I put it in here and it worked as advertised: map { my $f = $_; +{ #<<<<<<<<<<<<<<<<<<--- HERE map { $f->can($_) ? ( $_ => $f->$_() ) : () } @fields } } @foos On Wed, Oct 5, 2011 at 7:42 PM, Alfie John wrote: > Also, you could have reduced it down by returning a hashref on the > truth side of the ternary: > > map { > my $f = $_; > map { > $f->can($_) ? { $_ => $f->$_ } : () > } qw( label name html ) > } @fields > Pretty sure this wouldn't work. A hashref can't be assigned as the key of another hashref (well technically it can but it's not very useful - I think it would just stringify to HASHgobbledigook). > > It's a shame you can't access hidden scopes and you need to create a > temporary variable like $f here. Maybe Perl needs a way of accessing > outer block values e.g.: > > map { > map { > $_^->can($_) ? { $_ => $_^->$_ } : () > } > } @fields > The $_^ is $_ but one level higher (e.g. git's HEAD^ vs HEAD). But > since having multiple levels would look ugly (e.g. $_^^^ for 3 levels > out, maybe we also need a postfix operator like $_@ which is an array > containing the all of the $_ values for each level: > > $_@ = ( $_, $_^, $_^^, $_^^^ ); > > But this wouldn't just be for $_, it would work on all variables. That > way, when you local a variable, you can still access the hidden values > too. Perl already stores their values. > > Thoughts? > > Alfie > Because Perl really needs more special variables so that we don't have to bother naming anything ourselves. > > On Wed, Oct 5, 2011 at 7:24 PM, Alfie John wrote: > > Sorry... read my email during dinner. > > > > Here is what I did as a test: > > > > #!/usr/bin/perl; > > > > use warnings; > > use strict; > > > > package Foo; > > > > use base 'Class::Accessor'; > > > > my @fields = qw{ label name html }; > > Foo->mk_accessors( @fields ); > > > > sub new { > > my $self = bless {}, $_[0]; > > > > foreach my $field ( @fields ) { > > $self->$field( $field ); > > } > > > > return $self; > > } > > > > my @foos = map { Foo->new() } 1..3; > > > > use Data::Dumper; warn Dumper([ > > map { > > my $f = $_; > > { > > map { > > $f->can($_) ? ( $_ => $f->$_() ) : () > > } @fields > > } > > } @foos > > ]); > > > > It looks essentially the same as what you were running. This should > output: > > > > $VAR1 = [ > > { > > 'html' => 'html', > > 'name' => 'name', > > 'label' => 'label' > > }, > > { > > 'html' => 'html', > > 'name' => 'name', > > 'label' => 'label' > > }, > > { > > 'html' => 'html', > > 'name' => 'name', > > 'label' => 'label' > > } > > ]; > > > > Take out the + and you get: > > > > $VAR1 = [ > > 'label', > > 'label', > > 'name', > > 'name', > > 'html', > > 'html', > > 'label', > > 'label', > > 'name', > > 'name', > > 'html', > > 'html', > > 'label', > > 'label', > > 'name', > > 'name', > > 'html', > > 'html' > > ]; > > > > After looking at yours, it looks like the problem was the trailing > > semi colon after the qw[} :) > > > > Alfie > > > > On Wed, Oct 5, 2011 at 5:44 PM, Toby Corkindale > > wrote: > >> > >> On 05/10/11 17:38, Alfie John wrote: > >>> > >>> Whoops. That qw{} was in my test code. > >>> > >>> I added the + on the block and it worked for me. > >> > >> That is weird; I tried prefixing a + symbol to both the > left-hand-curly-braces in the maps (one at a time), to no avail! > >> > >> This is Perl 5.14.1.. > > > _______________________________________________ > 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 alfiejohn at gmail.com Wed Oct 5 03:51:47 2011 From: alfiejohn at gmail.com (Alfie John) Date: Wed, 5 Oct 2011 21:51:47 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> <4E8BF2A5.1060603@sericyb.com.au> <4E8BFCC0.8020901@strategicdata.com.au> Message-ID: Hey Myf, On Wed, Oct 5, 2011 at 9:03 PM, Myf White wrote: > The + was missing in your previous email. I put it in here and it worked as > advertised: > map { > ???? my $f = $_; > ???? +{???? #<<<<<<<<<<<<<<<<<<--- HERE > ???? ???? map { > ???? ???? ???? $f->can($_) ? ( $_ => $f->$_() ) : () > ???? ???? } @fields > ???? } > } @foos lol. I copied the wrong version. Yep, that's where it should have been. > On Wed, Oct 5, 2011 at 7:42 PM, Alfie John wrote: >> >> Also, you could have reduced it down by returning a hashref on the >> truth side of the ternary: >> >> ?map { >> ? ?my $f = $_; >> ? ?map { >> ? ? ?$f->can($_) ? { $_ => $f->$_ } : () >> ? ?} qw( label name html ) >> ?} @fields > > Pretty sure this wouldn't work. A hashref can't be assigned as the key of > another hashref (well technically it can but it's not very useful - I think > it would just stringify to HASHgobbledigook). I just ran it and it gives me what I want. I think the reason for your thinking is that you do: my %hash = map { do_stuff() }; But you can also do: my @array = map { do_stuff() }; Since do_stuff() here is returning a hashref each time, @array ends up as an array of hashes (which is what Toby needs). Alfie > >> >> It's a shame you can't access hidden scopes and you need to create a >> temporary variable like $f here. Maybe Perl needs a way of accessing >> outer block values e.g.: >> >> ?map { >> ? ?map { >> ? ? ?$_^->can($_) ? { $_ => $_^->$_ } : () >> ? ?} >> ?} @fields >> >> The $_^ is $_ but one level higher (e.g. git's HEAD^ vs HEAD). But >> since having multiple levels would look ugly (e.g. $_^^^ for 3 levels >> out, maybe we also need a postfix operator like $_@ which is an array >> containing the all of the $_ values for each level: >> >> ?$_@ = ( $_, $_^, $_^^, $_^^^ ); >> >> But this wouldn't just be for $_, it would work on all variables. That >> way, when you local a variable, you can still access the hidden values >> too. Perl already stores their values. >> >> Thoughts? >> >> Alfie > > Because Perl really needs more special variables so that we don't have to > bother naming anything ourselves. > >> >> On Wed, Oct 5, 2011 at 7:24 PM, Alfie John wrote: >> > Sorry... read my email during dinner. >> > >> > Here is what I did as a test: >> > >> > ?#!/usr/bin/perl; >> > >> > ?use warnings; >> > ?use strict; >> > >> > ?package Foo; >> > >> > ?use base 'Class::Accessor'; >> > >> > ?my @fields = qw{ label name html }; >> > ?Foo->mk_accessors( @fields ); >> > >> > ?sub new { >> > ? ?my $self = bless {}, $_[0]; >> > >> > ? ?foreach my $field ( @fields ) { >> > ? ? ? ? ? ?$self->$field( $field ); >> > ? ?} >> > >> > ? ?return $self; >> > ?} >> > >> > ?my @foos = map { Foo->new() } 1..3; >> > >> > ?use Data::Dumper; warn Dumper([ >> > ? ? ? ? ?map { >> > ? ? ? ? ? ? ? ? ?my $f = $_; >> > ? ? ? ? ? ? ? ? ?{ >> > ? ? ? ? ? ? ? ? ? ? ? ? ?map { >> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?$f->can($_) ? ( $_ => $f->$_() ) : () >> > ? ? ? ? ? ? ? ? ? ? ? ? ?} @fields >> > ? ? ? ? ? ? ? ? ?} >> > ? ? ? ? ?} @foos >> > ?]); >> > >> > It looks essentially the same as what you were running. This should >> > output: >> > >> > $VAR1 = [ >> > ? ? ? ? ?{ >> > ? ? ? ? ? ?'html' => 'html', >> > ? ? ? ? ? ?'name' => 'name', >> > ? ? ? ? ? ?'label' => 'label' >> > ? ? ? ? ?}, >> > ? ? ? ? ?{ >> > ? ? ? ? ? ?'html' => 'html', >> > ? ? ? ? ? ?'name' => 'name', >> > ? ? ? ? ? ?'label' => 'label' >> > ? ? ? ? ?}, >> > ? ? ? ? ?{ >> > ? ? ? ? ? ?'html' => 'html', >> > ? ? ? ? ? ?'name' => 'name', >> > ? ? ? ? ? ?'label' => 'label' >> > ? ? ? ? ?} >> > ? ? ? ?]; >> > >> > Take out the + and you get: >> > >> > $VAR1 = [ >> > ? ? ? ? ?'label', >> > ? ? ? ? ?'label', >> > ? ? ? ? ?'name', >> > ? ? ? ? ?'name', >> > ? ? ? ? ?'html', >> > ? ? ? ? ?'html', >> > ? ? ? ? ?'label', >> > ? ? ? ? ?'label', >> > ? ? ? ? ?'name', >> > ? ? ? ? ?'name', >> > ? ? ? ? ?'html', >> > ? ? ? ? ?'html', >> > ? ? ? ? ?'label', >> > ? ? ? ? ?'label', >> > ? ? ? ? ?'name', >> > ? ? ? ? ?'name', >> > ? ? ? ? ?'html', >> > ? ? ? ? ?'html' >> > ? ? ? ?]; >> > >> > After looking at yours, it looks like the problem was the trailing >> > semi colon after the qw[} :) >> > >> > Alfie >> > >> > On Wed, Oct 5, 2011 at 5:44 PM, Toby Corkindale >> > wrote: >> >> >> >> On 05/10/11 17:38, Alfie John wrote: >> >>> >> >>> Whoops. That qw{} was in my test code. >> >>> >> >>> I added the + on the block and it worked for me. >> >> >> >> That is weird; I tried prefixing a + symbol to both the >> >> left-hand-curly-braces in the maps (one at a time), to no avail! >> >> >> >> This is Perl 5.14.1.. >> > >> _______________________________________________ >> Melbourne-pm mailing list >> Melbourne-pm at pm.org >> http://mail.pm.org/mailman/listinfo/melbourne-pm > > From toby.corkindale at strategicdata.com.au Wed Oct 5 17:45:15 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Thu, 06 Oct 2011 11:45:15 +1100 Subject: [Melbourne-pm] Nested maps returning hash references In-Reply-To: References: <4E8BEC64.4060504@strategicdata.com.au> <4E8BEF34.3050700@sericyb.com.au> <4E8BF076.1010609@sericyb.com.au> <4E8BF0B1.3060809@strategicdata.com.au> <4E8BF0DD.4010406@sericyb.com.au> <4E8BF1D2.2000302@strategicdata.com.au> <4E8BF2A5.1060603@sericyb.com.au> <4E8BFCC0.8020901@strategicdata.com.au> Message-ID: <4E8CFA1B.60004@strategicdata.com.au> On 05/10/11 21:03, Myf White wrote: > Alfie, > > The + was missing in your previous email. I put it in here and it worked > as advertised: > map { > my $f = $_; > +{ #<<<<<<<<<<<<<<<<<<--- HERE > map { > $f->can($_) ? ( $_ => $f->$_() ) : () > } @fields > } > } @foos This is weird.. I still get an error when I do that. This code generates "syntax error at ./maptest.pl line 15, near "}"" .. aah, I need to lose the semi-colon on the inner map. my $foo = [ map { my $f = $_; +{ <--- plus added here map { $f->can($_) ? ($_ => $f->$_) : () } qw(label name html); <-- semi-colon must die } } @fields ]; I agree, the problem was Perl interpreting the braces as a block rather than a hash reference. Kind of annoying that it only uses a heuristic! Oh well, probably all my fault for trying to nest the damn things when I should have been jumping out to subroutines.. but you know how it goes, sometimes you just want to try it to see if it'll work :) From jarich at perltraining.com.au Wed Oct 5 23:27:57 2011 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Thu, 06 Oct 2011 17:27:57 +1100 Subject: [Melbourne-pm] [Fwd: [pm_groups] Potential group project: The Perl Cookbook] Message-ID: <4E8D4A6D.8080705@perltraining.com.au> This might be something Melbourne Perl folk might like to get involved in. -------- Forwarded Message -------- > From: G. Wade Johnson > To: pm_groups at pm.org > Subject: [pm_groups] Potential group project: The Perl Cookbook > Date: Tue, 4 Oct 2011 23:14:53 -0500 > > Ben Thomas and I were discussing the fact that The Perl Cookbook is > somewhat out of date and wondered if we could set up a project for > Houston.pm to try to bring some of the recipes up to the standards of > Modern Perl. > > As we discussed it, I realized that modifying a large number of these > recipes would quickly exceed the bounds of "fair use" should O'Reilly > decide to complain. So I contacted them through the user group program. > > The short form is that O'Reilly is at least provisionally interested in > the idea of a community project to update the Cookbook. They have done > other community-based cookbooks in the past, with some success. > > The question is, would more Perl Monger groups want to join in the > fun/work on this? > > Depending on the details that we are still ironing out, there would > likely be a website collecting new and updated recipes. We'd probably > want the source for the solutions on something like github. O'Reilly > would want the ability to collect a subset of the recipes (with input > from the community) to form a new edition of the book, if the project > goes well. > > The website would continue to be available for updates and contain all > recipes, not just those included in any book. > > I've pitched the initial idea to my group. (Without some of the details > at the moment.) Would any other groups be interested in joining in? If > you are interested, I'd be glad to forward the information I sent to my > group. > > I've also got a call next week with my O'Reilly contact to iron out > more details. Input from the larger Perl Monger community would > definitely help with that. > > Who is interested? > G. Wade > -- > "No Boom today. Boom tomorrow, There's always a boom tomorrow." > -- Ivanova, "Grail" > -- > Request pm.org Technical Support via support at pm.org > > pm_groups mailing list > pm_groups at pm.org > http://mail.pm.org/mailman/listinfo/pm_groups From toby.corkindale at strategicdata.com.au Sun Oct 9 16:42:44 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Mon, 10 Oct 2011 10:42:44 +1100 Subject: [Melbourne-pm] Melbourne Perlmongers meeting this wednesday Message-ID: <4E923174.1020508@strategicdata.com.au> Just a reminder that the Perlmongers meeting is this Wednesday at 6:30pm. See you all soon! Toby -------- Original Message -------- Subject: [Melbourne-pm] October Melbourne Perlmongers meeting Date: Thu, 29 Sep 2011 16:13:09 +1000 From: Toby Corkindale To: melbourne-pm Hello Perl Mongers, Our next meeting will be on Wednesday 12th of October, at 6:30pm. At the moment it looks like we will have Paul Fenwick speaking on the topic of "All Your Brains Suck - Known Bugs And Exploits In Wetware" I will give a rather short talk or demo on processing data using Hadoop clusters in Perl. I wondered if anyone else has a subject they care to speak upon? This meeting could be a good chance to practice a talk prior to OSDC.. And speaking of OSDC - we'll also be hosting the OSDC AGM after the regular Perl-mongers section. This meeting will be held at Strategic Data in Fitzroy; there will be some food and drinks thanks to contributions from the OSDC board and Strategic Data. Time: Wed 12 October 2011 at 6:30 PM Location: Level 2, 51-55 Johnston street Fitzroy, 3065 Cheers, Toby From toby.corkindale at strategicdata.com.au Tue Oct 11 17:39:28 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 12 Oct 2011 11:39:28 +1100 Subject: [Melbourne-pm] TONIGHT - Melbourne Perlmongers meeting Message-ID: <4E94E1C0.7070902@strategicdata.com.au> Just a reminder that the meeting is tonight! Looking forward to seeing you all there :) -Toby -------- Original Message -------- Subject: [Melbourne-pm] October Melbourne Perlmongers meeting Date: Thu, 29 Sep 2011 16:13:09 +1000 From: Toby Corkindale To: melbourne-pm Hello Perl Mongers, Our next meeting will be on Wednesday 12th of October, at 6:30pm. At the moment it looks like we will have Paul Fenwick speaking on the topic of "All Your Brains Suck - Known Bugs And Exploits In Wetware" I will give a rather short talk or demo on processing data using Hadoop clusters in Perl. I wondered if anyone else has a subject they care to speak upon? This meeting could be a good chance to practice a talk prior to OSDC.. And speaking of OSDC - we'll also be hosting the OSDC AGM after the regular Perl-mongers section. This meeting will be held at Strategic Data in Fitzroy; there will be some food and drinks thanks to contributions from the OSDC board and Strategic Data. Time: Wed 12 October 2011 at 6:30 PM Location: Level 2, 51-55 Johnston street Fitzroy, 3065 Cheers, Toby _______________________________________________ Melbourne-pm mailing list Melbourne-pm at pm.org http://mail.pm.org/mailman/listinfo/melbourne-pm From javier at candeira.com Thu Oct 13 06:26:48 2011 From: javier at candeira.com (Javier Candeira) Date: Fri, 14 Oct 2011 00:26:48 +1100 Subject: [Melbourne-pm] TONIGHT - Melbourne Perlmongers meeting In-Reply-To: <4E94E1C0.7070902@strategicdata.com.au> References: <4E94E1C0.7070902@strategicdata.com.au> Message-ID: Thanks everybody for the warm welcome, for the talks, and for the pizza! Slashedly yours, Javier On Wed, Oct 12, 2011 at 11:39 AM, Toby Corkindale wrote: > Just a reminder that the meeting is tonight! > Looking forward to seeing you all there :) > > -Toby > > -------- Original Message -------- > Subject: [Melbourne-pm] October Melbourne Perlmongers meeting > Date: Thu, 29 Sep 2011 16:13:09 +1000 > From: Toby Corkindale > To: melbourne-pm > > Hello Perl Mongers, > Our next meeting will be on Wednesday 12th of October, at 6:30pm. > > At the moment it looks like we will have Paul Fenwick speaking on the > topic of "All Your Brains Suck - Known Bugs And Exploits In Wetware" > > I will give a rather short talk or demo on processing data using Hadoop > clusters in Perl. > > I wondered if anyone else has a subject they care to speak upon? This > meeting could be a good chance to practice a talk prior to OSDC.. > > And speaking of OSDC - we'll also be hosting the OSDC AGM after the > regular Perl-mongers section. > > This meeting will be held at Strategic Data in Fitzroy; there will be > some food and drinks thanks to contributions from the OSDC board and > Strategic Data. > > > Time: > ?Wed 12 October 2011 at 6:30 PM > > Location: > ?Level 2, > ?51-55 Johnston street > ?Fitzroy, 3065 > > Cheers, > Toby > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > From myfwhite at gmail.com Sun Oct 16 02:15:50 2011 From: myfwhite at gmail.com (Myf White) Date: Sun, 16 Oct 2011 20:15:50 +1100 Subject: [Melbourne-pm] Mojolicious deployment Message-ID: Hi guys & girls, I am having some major problems getting my head around some stuff to do with deploying a Mojolicious app. It's not all Mojolicious related (some of it is basic networking / apache / permissions etc) and I'm really struggling to work it out, partly because my confusion is so great that I can't even express my questions properly. I was hoping that one of you had enough knowledge of Apache & Plack to maybe chat to me for about 20 mins to talk through it and give me some guidance. If so, that would be awesome and I would totally owe you a pint of your choice of beverage at the next pm meeting! Cheers, Myf White *Phone: *0413 757 052* Email:* myfwhite at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tjc at wintrmute.net Sun Oct 16 05:08:59 2011 From: tjc at wintrmute.net (Toby Wintermute) Date: Sun, 16 Oct 2011 23:08:59 +1100 Subject: [Melbourne-pm] Mojolicious deployment In-Reply-To: References: Message-ID: Hi Myf, Happy to chat more about this, but just some initial pointers.. 1) Install Starman from CPAN, and try and use that to get your app running inside it, on an arbitrary port, inside your own home directory. 2) Now create a new dedicated user on the system, and copy your application into its home directory, and get all the files owned by it. Then, as that user, check that you can again get it running via starman. Make a little shell script that includes all the right parameters to start it up. 3) Look into how to use init scripts or runit scripts to run that shell script as that particular user, automatically on start-up. 4) set up apache, varnish, nginx or lighttpd to simply proxy requests from port 80 over to the arbitrary port starman is running on. ideally, do some caching too. I suggest Varnish, out of the above options, but all of them can be used successfully. On 16 October 2011 20:15, Myf White wrote: > Hi guys & girls, > I am having some major problems getting my head around some stuff to do with > deploying a Mojolicious app. It's not all Mojolicious related (some of it is > basic networking / apache / permissions etc) and I'm really struggling to > work it out, partly because my confusion is so great that I can't even > express my questions properly. > I was hoping that one of you had enough knowledge of Apache & Plack to maybe > chat to me for about 20 mins to talk through it and give me some guidance. > If so, that would be awesome and I would totally owe you a pint of your > choice of beverage at the next pm meeting! > Cheers, > Myf White > > Phone: 0413 757 052 > Email: myfwhite at gmail.com > > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > -- Turning and turning in the widening gyre The falcon cannot hear the falconer Things fall apart; the center cannot hold Mere anarchy is loosed upon the world From myfwhite at gmail.com Sun Oct 16 05:51:09 2011 From: myfwhite at gmail.com (Myf White) Date: Sun, 16 Oct 2011 23:51:09 +1100 Subject: [Melbourne-pm] Mojolicious deployment In-Reply-To: References: Message-ID: Excellent. That, plus some offline pointers from Matt, should keep me busy. Turns out my issues were really Apache rewrite ones. I've just had a look at Starman documentation, and it seems great. I think the approach you've outlined should solve some of the other issues I was having. Kind Regards, Myf White *Phone: *0413 757 052* Email:* myfwhite at gmail.com On Sun, Oct 16, 2011 at 11:08 PM, Toby Wintermute wrote: > Hi Myf, > Happy to chat more about this, but just some initial pointers.. > > 1) Install Starman from CPAN, and try and use that to get your app > running inside it, on an arbitrary port, inside your own home > directory. > > 2) Now create a new dedicated user on the system, and copy your > application into its home directory, and get all the files owned by > it. Then, as that user, check that you can again get it running via > starman. > Make a little shell script that includes all the right parameters to > start it up. > > 3) Look into how to use init scripts or runit scripts to run that > shell script as that particular user, automatically on start-up. > > 4) set up apache, varnish, nginx or lighttpd to simply proxy requests > from port 80 over to the arbitrary port starman is running on. > ideally, do some caching too. I suggest Varnish, out of the above > options, but all of them can be used successfully. > > > On 16 October 2011 20:15, Myf White wrote: > > Hi guys & girls, > > I am having some major problems getting my head around some stuff to do > with > > deploying a Mojolicious app. It's not all Mojolicious related (some of it > is > > basic networking / apache / permissions etc) and I'm really struggling to > > work it out, partly because my confusion is so great that I can't even > > express my questions properly. > > I was hoping that one of you had enough knowledge of Apache & Plack to > maybe > > chat to me for about 20 mins to talk through it and give me some > guidance. > > If so, that would be awesome and I would totally owe you a pint of your > > choice of beverage at the next pm meeting! > > Cheers, > > Myf White > > > > Phone: 0413 757 052 > > Email: myfwhite at gmail.com > > > > _______________________________________________ > > Melbourne-pm mailing list > > Melbourne-pm at pm.org > > http://mail.pm.org/mailman/listinfo/melbourne-pm > > > > > > -- > Turning and turning in the widening gyre > The falcon cannot hear the falconer > Things fall apart; the center cannot hold > Mere anarchy is loosed upon the world > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jarich at perltraining.com.au Thu Oct 20 22:41:52 2011 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Fri, 21 Oct 2011 16:41:52 +1100 Subject: [Melbourne-pm] Oceania Women of Open Tech launches Message-ID: <4EA10620.7060406@perltraining.com.au> In case there are any women or other interested folk on this mailing list who don't know about OWOOT. Oceania Women of Open Tech (OWOOT) is a new group for women in open technology in Australia, New Zealand and the Pacific Islands. It has recently formed from the local chapters of LinuxChix, but with a wider scope focusing on open technology generally. OWOOT welcomes all women interested in open technology, including open source, open hardware, open data and free culture. OWOOT activities will include: - the Haecksen mini-conference at linux.conf.au, and meetups and events at other conferences - periodic local social events - email and IRC forums where you can meet other women from the area who work with, build or use open technology OWOOT forums are open to men to join if they wish, as long as they keep in mind that the purpose of the group is supporting women in open tech and allowing them to meet each other. Find out more about OWOOT at our website: http://owoot.org/ Join the OWOOT email list and chat channel: http://owoot.org/Join From toby.corkindale at strategicdata.com.au Tue Oct 25 00:48:58 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Tue, 25 Oct 2011 18:48:58 +1100 Subject: [Melbourne-pm] Next Perl mongers meeting - call for presenters Message-ID: <4EA669EA.30303@strategicdata.com.au> Hello Perl mongers, The next Melbourne Perl-mongers meeting will be on the second wednesday of the month as usual - so, November the 9th. We need some volunteers to present things! Is anyone prepared to do so? thanks, Toby From toby.corkindale at strategicdata.com.au Wed Oct 26 22:07:45 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Thu, 27 Oct 2011 16:07:45 +1100 Subject: [Melbourne-pm] I <3 map & grep Message-ID: <4EA8E721.5020706@strategicdata.com.au> But perhaps, a little too much.. I just found myself this: use Config::General qw(ParseConfig); ... opendir(my $dir, $self->sites_dir) or die..; my %sites = map { $_->{name} => Streuth::Site->new($_) } map { { ParseConfig($_) } } grep { -f $_ } map { File::Spec->catfile($self->sites_dir, $_) } grep { /^[-_a-zA-Z\d\.]+$/ } readdir($dir); closedir $dir; return \%sites; From toby.corkindale at strategicdata.com.au Wed Oct 26 22:34:37 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Thu, 27 Oct 2011 16:34:37 +1100 Subject: [Melbourne-pm] I <3 map & grep In-Reply-To: References: <4EA8E721.5020706@strategicdata.com.au> Message-ID: <4EA8ED6D.6000000@strategicdata.com.au> On 27/10/11 16:25, Myf White wrote: > Have you thought about using File::Find::Rule? Good point, that would probably look a bit more sane. Although to achieve the same behaviour I think I'd need to add more parameters, like maxdepth and a regex. I think I was going to use my regex to eliminate files such as .filename.swp and the like, but that's not what it's doing now. I should fix it up. Cheers, Toby > my %sites = > map { $_->{name} => Streuth::Site->new($_) } > map { { ParseConfig($_) }} > File::Find::Rule->file()->in( $self->sites_dir ); > > > Kind Regards, > Myf White* > Email:*myfwhite at gmail.com > > > On Thu, Oct 27, 2011 at 4:07 PM, Toby Corkindale > > wrote: > > But perhaps, a little too much.. > I just found myself this: > > > use Config::General qw(ParseConfig); > ... > opendir(my $dir, $self->sites_dir) or die..; > > my %sites = map { $_->{name} => Streuth::Site->new($_) } > map { { ParseConfig($_) } } > grep { -f $_ } > map { File::Spec->catfile($self->__sites_dir, $_) } > grep { /^[-_a-zA-Z\d\.]+$/ } > readdir($dir); > > closedir $dir; > return \%sites; > > _________________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/__listinfo/melbourne-pm > > > -- .signature From sam at nipl.net Wed Oct 26 23:12:25 2011 From: sam at nipl.net (Sam Watkins) Date: Thu, 27 Oct 2011 17:12:25 +1100 Subject: [Melbourne-pm] I <3 map & grep too :) In-Reply-To: <4EA8E721.5020706@strategicdata.com.au> References: <4EA8E721.5020706@strategicdata.com.au> Message-ID: <20111027061225.GV11592@opal.ai.ki> On Thu, Oct 27, 2011 at 04:07:45PM +1100, Toby Corkindale wrote: > But perhaps, a little too much.. > I just found myself this: > > > use Config::General qw(ParseConfig); > ... > opendir(my $dir, $self->sites_dir) or die..; > > my %sites = map { $_->{name} => Streuth::Site->new($_) } > map { { ParseConfig($_) } } > grep { -f $_ } > map { File::Spec->catfile($self->sites_dir, $_) } > grep { /^[-_a-zA-Z\d\.]+$/ } > readdir($dir); > > closedir $dir; > return \%sites; Looks good to me :) I usually read map/grep chains in perl from the bottom up, maybe because I'm accustomed to the shell's way of doing it. I've been reading about 'flow based programming', your snippet would fits nicely in that data-flow style of programming (or the functional style). An advantage of map / grep / reduce, compared to 'for', is that a program like this could be run in parallel, in two different ways. It could operate on multiple data in parallel (shell doesn't normally do that), and it could use 'pipelining' with all the steps running in parallel (shell does do that). I guess that's why google is keen on 'map-reduce' programming, such a program can take good advantage of pretty much however many processors you care to throw at it. Given enough 'workers', a data flow system can process whole arrays with the same throughput / bandwidth as the slowest 'bottleneck' worker operates on a single item. For example if it takes 1ns to do a binary arithmetic addition, we could find the sum of 1024 numbers in 10ns using a 'tree' with 10 levels of adding units, it would have 1023 adders in total. If we have a stream of float[1024] arrays, from a robot eye or ear or whatever, we can process them at the rate of 1 billion arrays per second. At any one time we have 10 arrays going through the system, one at each level. The latency is 10ns, but throughput is 1 billion arrays per second, it would input 1024 billion numbers per second and output 1 billion totals per second. I don't know a faster way to do it! :) From sam at nipl.net Wed Oct 26 23:17:18 2011 From: sam at nipl.net (Sam Watkins) Date: Thu, 27 Oct 2011 17:17:18 +1100 Subject: [Melbourne-pm] I <3 map & grep In-Reply-To: <4EA8ED6D.6000000@strategicdata.com.au> References: <4EA8E721.5020706@strategicdata.com.au> <4EA8ED6D.6000000@strategicdata.com.au> Message-ID: <20111027061718.GW11592@opal.ai.ki> On Thu, Oct 27, 2011 at 04:34:37PM +1100, Toby Corkindale wrote: > I think I was going to use my regex to eliminate files such as > .filename.swp and the like, but that's not what it's doing now. > I should fix it up. > > grep { /^[-_a-zA-Z\d\.]+$/ } Yeah you don't want those pesky hidden files matching with the . ! This seems to do it: grep { /^\w[-\w\.]*$/ } Tested with: ls -a | perl -ne 'print if /^\w[-\w\.]*$/' | less ls -a | perl -ne 'print if !/^\w[-\w\.]*$/' | less in my home directory, which has plenty of weird filenames in it! Sam From toby.corkindale at strategicdata.com.au Wed Oct 26 23:22:11 2011 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Thu, 27 Oct 2011 17:22:11 +1100 Subject: [Melbourne-pm] I <3 map & grep too :) In-Reply-To: <20111027061225.GV11592@opal.ai.ki> References: <4EA8E721.5020706@strategicdata.com.au> <20111027061225.GV11592@opal.ai.ki> Message-ID: <4EA8F893.8050509@strategicdata.com.au> On 27/10/11 17:12, Sam Watkins wrote: > On Thu, Oct 27, 2011 at 04:07:45PM +1100, Toby Corkindale wrote: >> But perhaps, a little too much.. >> I just found myself this: >> >> >> use Config::General qw(ParseConfig); >> ... >> opendir(my $dir, $self->sites_dir) or die..; >> >> my %sites = map { $_->{name} => Streuth::Site->new($_) } >> map { { ParseConfig($_) } } >> grep { -f $_ } >> map { File::Spec->catfile($self->sites_dir, $_) } >> grep { /^[-_a-zA-Z\d\.]+$/ } >> readdir($dir); >> >> closedir $dir; >> return \%sites; > > Looks good to me :) > > I usually read map/grep chains in perl from the bottom up, > maybe because I'm accustomed to the shell's way of doing it. > > I've been reading about 'flow based programming', your snippet would > fits nicely in that data-flow style of programming (or the functional style). > > An advantage of map / grep / reduce, compared to 'for', is that a program like > this could be run in parallel, in two different ways. It could operate on > multiple data in parallel (shell doesn't normally do that), and it could use > 'pipelining' with all the steps running in parallel (shell does do that). And indeed, I picked up this style of programming from Scala, which does do those operations in parallel - in both senses. It can start running the later operations before the early ones have finished - and it can use multiple CPUs to process each stage in parallel. It's pretty nifty, and I hope Perl gets functionality like that one day too.. Toby From celtic at sairyx.org Thu Oct 27 00:04:38 2011 From: celtic at sairyx.org (Anneli Cuss) Date: Thu, 27 Oct 2011 18:04:38 +1100 Subject: [Melbourne-pm] I <3 map & grep too :) In-Reply-To: <4EA8F893.8050509@strategicdata.com.au> References: <4EA8E721.5020706@strategicdata.com.au> <20111027061225.GV11592@opal.ai.ki> <4EA8F893.8050509@strategicdata.com.au> Message-ID: > It's pretty nifty, and I hope Perl gets functionality like that one day > too.. No better way to make that happen than to make that happen. ;-) > Toby - Anneli (a newcomer) From sam at nipl.net Thu Oct 27 00:23:32 2011 From: sam at nipl.net (Sam Watkins) Date: Thu, 27 Oct 2011 18:23:32 +1100 Subject: [Melbourne-pm] I <3 map & grep too :) In-Reply-To: <4EA8F893.8050509@strategicdata.com.au> References: <4EA8E721.5020706@strategicdata.com.au> <20111027061225.GV11592@opal.ai.ki> <4EA8F893.8050509@strategicdata.com.au> Message-ID: <20111027072332.GZ11592@opal.ai.ki> > I picked up this style of programming from Scala, which does do those > operations in parallel - in both senses. It can start running the later > operations before the early ones have finished - and it can use multiple CPUs > to process each stage in parallel. That's nifty indeed, I had no idea Scala could do that. Can you point me at some little example or web page about that kind of capability in Scala? I had a little google at it but didn't find. I might learn Scala if it can do that. thanks, Sam From sam at nipl.net Thu Oct 27 00:43:57 2011 From: sam at nipl.net (Sam Watkins) Date: Thu, 27 Oct 2011 18:43:57 +1100 Subject: [Melbourne-pm] code filters In-Reply-To: <20111027072332.GZ11592@opal.ai.ki> References: <4EA8E721.5020706@strategicdata.com.au> <20111027061225.GV11592@opal.ai.ki> <4EA8F893.8050509@strategicdata.com.au> <20111027072332.GZ11592@opal.ai.ki> Message-ID: <20111027074357.GA11592@opal.ai.ki> I wrote a source code filter for perl a while ago, because I python syntax. This is the test program for it: http://sam.ai.ki/code/sane.pl/test.pl but I've never used it for anything as of yet! Also wrote a filter for python which lets you access objects members as @foo instead of self.foo, and don't have to declare the 'self'. I called that 'whython' and used it for one program only! http://sam.ai.ki/code/graph.1/old/editor/graph.why It would be better to use .foo to access a member, not @foo. And certainly not self.foo or $self->{foo} aargh!!! Or go like C++ / Java and just access it as 'foo'. /EOT From celtic at sairyx.org Thu Oct 27 02:26:18 2011 From: celtic at sairyx.org (Anneli Cuss) Date: Thu, 27 Oct 2011 20:26:18 +1100 Subject: [Melbourne-pm] I <3 map & grep too :) In-Reply-To: <4EA8F893.8050509@strategicdata.com.au> References: <4EA8E721.5020706@strategicdata.com.au> <20111027061225.GV11592@opal.ai.ki> <4EA8F893.8050509@strategicdata.com.au> Message-ID: > And indeed, I picked up this style of programming from Scala, which does do > those operations in parallel - in both senses. > It can start running the later operations before the early ones have > finished - and it can use multiple CPUs to process each stage in parallel. I misunderstood the point you were making, but I might as well share what I've got, as it could serve as a springboard for others. It shouldn't be too hard to feed results into subsequent operations early (though you might need to ugly up the syntax or use something like iterators to make it happen). I'm sure there's already this on the CPAN (or ten of them), but maybe it'll be as fun for others to read as it was for me to write. A simple parallel map: use threads; use threads::shared; our $PARALLEL = 4; sub pmap (&@) { my $fun = shift; my @args :shared = @_; my $each = @args / $PARALLEL; my @threads; for ($i = 0; $i < $PARALLEL; ++$i) { my $from = $each * $i; my $to = ($i < $PARALLEL - 1) ? ($each * ($i + 1) - 1) : $#args; print STDERR "from $from to $to\n"; my ($thr) = threads->create(sub { map &$fun, @args[$from..$to] }); push @threads, $thr; } print STDERR "joining\n"; my @results; push @results, $_->join for (@threads); @results; } Adjust $PARALLEL to the number of cores your CPU has. SERVING SUGGESTION: sub dumb_fib { my $n = shift; $n <= 2 ? 1 : dumb_fib($n-1) + dumb_fib($n-2) } my @a = (39) x 8; my @r = pmap { dumb_fib $_ } @a; print join ', ', @r; With $PARALLEL = 8 on a suitable server: $ time perl pmap.pl from 0 to 0 from 1 to 1 from 2 to 2 from 3 to 3 from 4 to 4 from 5 to 5 from 6 to 6 from 7 to 7 joining 63245986, 63245986, 63245986, 63245986, 63245986, 63245986, 63245986, 63245986 real 1m20.436s user 10m36.575s sys 0m0.188s $ If I replace 'pmap' with 'map': $ time perl map.pl 63245986, 63245986, 63245986, 63245986, 63245986, 63245986, 63245986, 63245986 real 5m56.631s user 5m56.570s sys 0m0.006s $ So, half the time spent in the CPU (not managing context switches), but 5 times longer on the wall! - Anneli From daniel at rimspace.net Thu Oct 27 08:22:16 2011 From: daniel at rimspace.net (Daniel Pittman) Date: Thu, 27 Oct 2011 08:22:16 -0700 Subject: [Melbourne-pm] I <3 map & grep too :) In-Reply-To: <20111027072332.GZ11592@opal.ai.ki> References: <4EA8E721.5020706@strategicdata.com.au> <20111027061225.GV11592@opal.ai.ki> <4EA8F893.8050509@strategicdata.com.au> <20111027072332.GZ11592@opal.ai.ki> Message-ID: On Thu, Oct 27, 2011 at 00:23, Sam Watkins wrote: >> I picked up this style of programming from Scala, which does do those >> operations in parallel - in both senses. ?It can start running the later >> operations before the early ones have finished - and it can use multiple CPUs >> to process each stage in parallel. > > That's nifty indeed, I had no idea Scala could do that. ?Can you point me at > some little example or web page about that kind of capability in Scala? ?I had > a little google at it but didn't find. It is (well, was) actually pretty hard to find, because parallel is so deeply baked into Scala; it is much more a core feature, as in lazy, so unlike the normal "threads" model where you have all sorts of ceremony, Scala keeps it pretty quiet. However, http://debasishg.blogspot.com/2008/06/playing-around-with-parallel-maps-in.html is a pretty good guide to how you would build out a tool at the low level. At the gross level? s/map/pmap/, and you are done. (No, literally, one extra letter maps to using all cores. :) Because Scala strongly encourages functional programming, most things can be spread across cores with roughly linear improvement. All this is true also of Clojure, which seems to be the other solid competitor in the JVM hosted language space. Daniel -- ? Made with 100 percent post-consumer electrons From daniel at rimspace.net Thu Oct 27 08:24:03 2011 From: daniel at rimspace.net (Daniel Pittman) Date: Thu, 27 Oct 2011 08:24:03 -0700 Subject: [Melbourne-pm] I <3 map & grep In-Reply-To: <4EA8E721.5020706@strategicdata.com.au> References: <4EA8E721.5020706@strategicdata.com.au> Message-ID: On Wed, Oct 26, 2011 at 22:07, Toby Corkindale wrote: > But perhaps, a little too much.. > I just found myself this: I would have simplified this so: > ? ?use Config::General qw(ParseConfig); use Path::Class; > ? ?... > ? ?opendir(my $dir, $self->sites_dir) or die..; > > ? ?my %sites = map ?{ $_->{name} => Streuth::Site->new($_) } > ? ? ? ? ? ? ? ?map ?{ { ParseConfig($_) } } > ? ? ? ? ? ? ? ?grep { -f $_ } > ? ? ? ? ? ? ? ?map ?{ File::Spec->catfile($self->sites_dir, $_) } map { file($self->sites_dir, $_) } > ? ? ? ? ? ? ? ?grep { /^[-_a-zA-Z\d\.]+$/ } > ? ? ? ? ? ? ? ?readdir($dir); ...which gives a richer set of interfaces around the object. You see more benefit when you do more than just "is it a file", etc, and there are some internal directory iteration tools if you want. Daniel -- ? Made with 100 percent post-consumer electrons From list at bereft.net Thu Oct 27 15:12:45 2011 From: list at bereft.net (Brad Bowman) Date: Fri, 28 Oct 2011 09:12:45 +1100 Subject: [Melbourne-pm] I <3 map & grep too :) In-Reply-To: <4EA8F893.8050509@strategicdata.com.au> References: <4EA8E721.5020706@strategicdata.com.au> <20111027061225.GV11592@opal.ai.ki> <4EA8F893.8050509@strategicdata.com.au> Message-ID: <4EA9D75D.7030907@bereft.net> On 27/10/11 17:22, Toby Corkindale wrote: > On 27/10/11 17:12, Sam Watkins wrote: [..] >> I usually read map/grep chains in perl from the bottom up, >> maybe because I'm accustomed to the shell's way of doing it. [...] >> An advantage of map / grep / reduce, compared to 'for', is that a program like >> this could be run in parallel, in two different ways. It could operate on >> multiple data in parallel (shell doesn't normally do that), and it could use >> 'pipelining' with all the steps running in parallel (shell does do that). > > > And indeed, I picked up this style of programming from Scala, which does do > those operations in parallel - in both senses. > It can start running the later operations before the early ones have finished > - and it can use multiple CPUs to process each stage in parallel. > > It's pretty nifty, and I hope Perl gets functionality like that one day too.. Perl 6 has feed operators: http://perlcabal.org/syn/S03.html#Feed_operators I think they're lazy/pull-based like unix pipes, but don't auto-thread (that's hyperops). One nice novelty is that there are two options: <== and ==>. <== reads bottom to top like the Perl 5 example, but ==> allows the chain to be written the other way (like unix). It appears there are parallel variants: <<== and ==>> (I can't be sure from s03 though) Brad From alecclews at gmail.com Thu Oct 27 15:23:09 2011 From: alecclews at gmail.com (Alec Clews) Date: Fri, 28 Oct 2011 09:23:09 +1100 Subject: [Melbourne-pm] Toodles and thanks Message-ID: <7DED6D41-8A62-4745-B1A7-4382C8C0A8E1@gmail.com> Folks, I'm going to remove myself from the mailing list as I don't do much programming these days and I don't work in the city anymore. Many thanks for the friendship and technical companionship over the years. Cheers -- Alec Clews Personal Melbourne, Australia. Jabber: alecclews at jabber.org.au PGPKey ID: 0x9BBBFC7C blog:http://alecthegeek.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From sam at nipl.net Thu Oct 27 17:41:07 2011 From: sam at nipl.net (Sam Watkins) Date: Fri, 28 Oct 2011 11:41:07 +1100 Subject: [Melbourne-pm] I <3 map & grep too :) In-Reply-To: References: <4EA8E721.5020706@strategicdata.com.au> <20111027061225.GV11592@opal.ai.ki> <4EA8F893.8050509@strategicdata.com.au> Message-ID: <20111028004107.GD11592@opal.ai.ki> Anneli Cuss wrote: > sub pmap (&@) { That's cool, I didn't realise it was so easy to use threads in perl these days... :) thanks, that can be useful