From jarich at perltraining.com.au Wed Apr 7 17:34:51 2010 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Thu, 08 Apr 2010 10:34:51 +1000 Subject: [Melbourne-pm] Open Source Developers' Club AGM - 19 April 2010 Message-ID: <4BBD24AB.6090001@perltraining.com.au> G'day folk, This doesn't seem to have been sent on to the MPM list yet. If you're free next Monday and would like to have a say in how the OSDC exec is populated for the next year, please turn up to the OSDC AGM. Additionally, after the AGM (which shouldn't take long) will be the OSDClub meeting with talks that will hopefully interest all of you. J -------------- next part -------------- An embedded message was scrubbed... From: Ben Balbo Subject: [OSDC:ClubAnnounce] Open Source Developers' Club AGM - 19 April 2010 Date: Thu, 11 Mar 2010 13:24:37 +1100 Size: 7198 URL: From ben at benbalbo.com Wed Apr 7 17:57:10 2010 From: ben at benbalbo.com (Ben Balbo) Date: Thu, 08 Apr 2010 10:57:10 +1000 Subject: [Melbourne-pm] Open Source Developers' Club AGM - 19 April 2010 In-Reply-To: <4BBD24AB.6090001@perltraining.com.au> References: <4BBD24AB.6090001@perltraining.com.au> Message-ID: <4BBD29E6.70107@benbalbo.com> > This doesn't seem to have been sent on to the MPM list yet. If you're > free next Monday The Monday after - 19th ;) > and would like to have a say in how the OSDC exec is > populated for the next year, please turn up to the OSDC AGM. See you there! BB > ------------------------------------------------------------------------ > > Subject: > [OSDC:ClubAnnounce] Open Source Developers' Club AGM - 19 April 2010 > From: > Ben Balbo > Date: > Thu, 11 Mar 2010 13:24:37 +1100 > To: > OSDClub Announce > > To: > OSDClub Announce > > > Yes folks, it's that time of year again. The OSDClub AGM is upon us! > Please note the AGM will be held during the next OSDClub meeting, kindly > hosted by the Melbourne PHP User's Group. Presentations, details of > which will be advised separately, will follow the AGM. > > The Open Source Developers' Club AGM will be held on Monday the 19th of > April at 7:00pm at: > > Room 18, Level 3 > Building 8, RMIT > 368 Swanston St > Map: http://phpmelb.org/map/ > > The AGM will be held to elect a new executive committee for the > organisation. Duties of the executive committee are mostly > administrative and include considering applications for funding from > open source groups and initiatives such as the bimonthly OSDClub > meetings and Open Source Developers' Conference, and providing an > umbrella organisation to Australian open source user groups such as the > Melbourne Perl Mongers and the Melbourne PHP Users Group. > > Organisation of the Open Source Developers' Conference, bimonthly > meetings, user groups and other associated groups that operate under the > banner of the Open Source Developers' Club are performed by their > respective organisers and the OSDClub executive committee members will > not be required to assist in these areas as part of their position on > the executive committee. They may of course elect to assist of their own > accord. > > Nominations for positions on the executive committee may be made by the > Sunday the 11th April 2010 by email to ben at benbalbo.com. > > Your message should include: > * the name of the person you are nominating, > * the position you are nominating them for > > Valid nominations will be those where two members have nominated the > same person for the same position. For the purposes of nominations, a > member will be considered to be a person who was a member of the OSDC > Announce list at the time this AGM was formally announced (Thu Mar 11 > 13:26:47 EST 2010). > > To make the nomination process as efficient as possible, please email > nominations from the same email address that you are subscribed to the > OSDC Announce list. Nominations from email addresses not on the list of > members may be silently rejected. > > The positions for nominations are: > > - 1 x President (Committee Chair) > - 1 x Vice-President > - 1 x Secretary > - 1 x Treasurer > - 2+ x Ordinary Committee Members > > Everyone is welcome at the AGM. This is a grass roots effort and we need > all the help we can get. > > > Thanks! > Ben Balbo > > > ------------------------------------------------------------------------ > > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 258 bytes Desc: OpenPGP digital signature URL: From T.Hunt at bom.gov.au Sun Apr 11 16:57:50 2010 From: T.Hunt at bom.gov.au (Timothy Hunt) Date: Mon, 12 Apr 2010 09:57:50 +1000 Subject: [Melbourne-pm] Recruitment agencies [SEC=UNCLASSIFIED] Message-ID: <7548A47B0E2E8643BE38DBBD8FD9CA1AB51C2C88C4@BOM-VMBX-HO.bom.gov.au> I recently met a German (friend of a friend) who's fed up of telecommuting back home. He's got a 4 year work visa and is looking for contract work in Melbourne (which is where his wife has a four year contract - hence his presence here.) Unfortunately I don't know his speciality/ies. Can anyone who's had *positive* experiences with agencies please drop me a one-liner with the agency name / web site? Many thanks in advance, Tim Hunt. From adrian.muhrer at rea-group.com Sun Apr 11 18:28:23 2010 From: adrian.muhrer at rea-group.com (Adrian Muhrer) Date: Mon, 12 Apr 2010 11:28:23 +1000 Subject: [Melbourne-pm] Recruitment agencies [SEC=UNCLASSIFIED] In-Reply-To: <7548A47B0E2E8643BE38DBBD8FD9CA1AB51C2C88C4@BOM-VMBX-HO.bom.gov.au> References: <7548A47B0E2E8643BE38DBBD8FD9CA1AB51C2C88C4@BOM-VMBX-HO.bom.gov.au> Message-ID: <201004121128.23312.adrian.muhrer@rea-group.com> On 10Y-04-12 09:57:50 Timothy Hunt wrote: > I recently met a German (friend of a friend) who's fed up of telecommuting > back home. He's got a 4 year work visa and is looking for contract work in > Melbourne (which is where his wife has a four year contract - hence his > presence here.) Unfortunately I don't know his speciality/ies. > > Can anyone who's had *positive* experiences with agencies please drop me a > one-liner with the agency name / web site? > > Many thanks in advance, > > Tim Hunt. > > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm > i've had good experiences with georgie georgie at georgiecarpenter.com From sgc294 at internode.on.net Mon Apr 12 22:55:43 2010 From: sgc294 at internode.on.net (Andrew Dent) Date: Tue, 13 Apr 2010 15:55:43 +1000 Subject: [Melbourne-pm] April 14 Perl Mongers Meeting? Message-ID: <4BC4075F.4060905@internode.on.net> G'day Is there a Perl Mongers meeting this month? Cheers Andrew Dent From alfiejohn at gmail.com Tue Apr 13 01:49:01 2010 From: alfiejohn at gmail.com (Alfie John) Date: Tue, 13 Apr 2010 18:49:01 +1000 Subject: [Melbourne-pm] April 14 Perl Mongers Meeting? In-Reply-To: <4BC4075F.4060905@internode.on.net> References: <4BC4075F.4060905@internode.on.net> Message-ID: Hey Andrew, Don't think so. This is an OSDC month. See Jacinta's email last week for details. Alfie On Tue, Apr 13, 2010 at 3:55 PM, Andrew Dent wrote: > G'day > > Is there a Perl Mongers meeting this month? > > Cheers > > Andrew Dent > _______________________________________________ > 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 pjf at perltraining.com.au Tue Apr 13 02:14:53 2010 From: pjf at perltraining.com.au (Paul Fenwick) Date: Tue, 13 Apr 2010 19:14:53 +1000 Subject: [Melbourne-pm] April 14 Perl Mongers Meeting! In-Reply-To: <4BC4075F.4060905@internode.on.net> References: <4BC4075F.4060905@internode.on.net> Message-ID: <4BC4360D.9040703@perltraining.com.au> G'day Melb.pm, Andrew Dent wrote: > Is there a Perl Mongers meeting this month? Alfie said: > Don't think so. This is an OSDC month. See Jacinta's email last week for details. However, while we have no speakers lined up, and REA is not available for this month, I think we can do what every other Perl Mongers group in the world does, and have a social meeting! ;) Plus, Perl 5.12.0 just hit the world a couple of hours ago[1]. That's definitely something to raise a glass to. Suggestions of drinking holes welcome. ;) Cheerio, Paul [1] http://search.cpan.org/perldoc?perl5120delta -- Paul Fenwick | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia | Fax: +61 3 9354 2681 From melbourne-pm at popcorn.cx Tue Apr 13 03:21:55 2010 From: melbourne-pm at popcorn.cx (Stephen Edmonds) Date: Tue, 13 Apr 2010 20:21:55 +1000 Subject: [Melbourne-pm] April 14 Perl Mongers Meeting! In-Reply-To: <4BC4360D.9040703@perltraining.com.au> References: <4BC4075F.4060905@internode.on.net> <4BC4360D.9040703@perltraining.com.au> Message-ID: <4BC445C3.2080704@popcorn.cx> I'm up for a social evening, but I don't really know many drinking holes in order to recommend one. However, to get the ball rolling, I suggest our old regular: Beer Deluxe Stephen Paul Fenwick wrote: > G'day Melb.pm, > > Andrew Dent wrote: > >> Is there a Perl Mongers meeting this month? > > Alfie said: > >> Don't think so. This is an OSDC month. See Jacinta's email last week for details. > > However, while we have no speakers lined up, and REA is not available for > this month, I think we can do what every other Perl Mongers group in the > world does, and have a social meeting! ;) > > Plus, Perl 5.12.0 just hit the world a couple of hours ago[1]. That's > definitely something to raise a glass to. > > Suggestions of drinking holes welcome. ;) > > Cheerio, > > Paul > > [1] http://search.cpan.org/perldoc?perl5120delta > -- Stephen Edmonds Melbourne, Australia stephen at popcorn.cx http://popcorn.cx/ From tjc at wintrmute.net Tue Apr 13 03:52:41 2010 From: tjc at wintrmute.net (Toby Wintermute) Date: Tue, 13 Apr 2010 20:52:41 +1000 Subject: [Melbourne-pm] April 14 Perl Mongers Meeting! In-Reply-To: <4BC4360D.9040703@perltraining.com.au> References: <4BC4075F.4060905@internode.on.net> <4BC4360D.9040703@perltraining.com.au> Message-ID: On 13 April 2010 19:14, Paul Fenwick wrote: > G'day Melb.pm, > > Andrew Dent wrote: > >> Is there a Perl Mongers meeting this month? > > Alfie said: > >> Don't think so. This is an OSDC month. See Jacinta's email last week for details. > > However, while we have no speakers lined up, and REA is not available for > this month, I think we can do what every other Perl Mongers group in the > world does, and have a social meeting! ?;) > > Plus, Perl 5.12.0 just hit the world a couple of hours ago[1]. ?That's > definitely something to raise a glass to. It's just a small change, but the one I'm looking forward to the most is finally getting rid of 'use strict' and 'use warnings' on 5.12. > Suggestions of drinking holes welcome. ;) Horse Bazaar on Little Lonsdale is small and we might struggle to get a table, or hear each other, but it has decent drinks and cool multimedia stuff. Often decent music too. The Lounge on Swanston St is large, does food, beer and coffee. I don't think they have any busy nights on a Wednesday, but I've never really checked before either. The Workshop on corner of Elizabeth and A'Beckett also does food, good beers, cider on tap too, and has wifi. Actually, yeah, I reckon the Workshop would be the best of those three. It has more soul than Bar Deluxe, fewer exotic beers, but is cheaper to boot :) -Toby From pat at patspam.com Tue Apr 13 07:31:21 2010 From: pat at patspam.com (Patrick Donelan) Date: Tue, 13 Apr 2010 10:31:21 -0400 Subject: [Melbourne-pm] April 14 Perl Mongers Meeting! In-Reply-To: References: <4BC4075F.4060905@internode.on.net> <4BC4360D.9040703@perltraining.com.au> Message-ID: > > It's just a small change, but the one I'm looking forward to the most > is finally getting rid of 'use strict' and 'use warnings' on 5.12. > Only strictures, not warnings I think? Adam would have a hernia if they enabled warnings by default.. Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From pat at patspam.com Tue Apr 13 09:26:50 2010 From: pat at patspam.com (Patrick Donelan) Date: Tue, 13 Apr 2010 12:26:50 -0400 Subject: [Melbourne-pm] April 14 Perl Mongers Meeting! In-Reply-To: References: <4BC4075F.4060905@internode.on.net> <4BC4360D.9040703@perltraining.com.au> Message-ID: Although I did just notice this in the release announcement : Perl now warns the user about the use of deprecated features by default So I guess we do get more warnings in 5.12.0 too. Patrick On Tue, Apr 13, 2010 at 10:31 AM, Patrick Donelan wrote: > It's just a small change, but the one I'm looking forward to the most >> is finally getting rid of 'use strict' and 'use warnings' on 5.12. >> > > Only strictures, not warnings I think? > > Adam would have a hernia if > they enabled warnings by default.. > > Patrick > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alecclews at gmail.com Tue Apr 13 17:05:08 2010 From: alecclews at gmail.com (alecclews at gmail.com) Date: Wed, 14 Apr 2010 00:05:08 +0000 (UTC) Subject: [Melbourne-pm] April 14 Perl Mongers Meeting? Message-ID: <31959615.13374.1271203509202.JavaMail.seven@ap6.p8.sca.7sys.net> my laptop battery is cactus so if the lounge has power...... But sounds best so far ---- Sent from my 3 mobile -original message- Subject: [Melbourne-pm] April 14 Perl Mongers Meeting? From: "Andrew Dent" Date: 13/04/2010 15:56 G'day Is there a Perl Mongers meeting this month? Cheers Andrew Dent _______________________________________________ Melbourne-pm mailing list Melbourne-pm at pm.org http://mail.pm.org/mailman/listinfo/melbourne-pm From toby.corkindale at strategicdata.com.au Tue Apr 13 17:57:51 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 14 Apr 2010 10:57:51 +1000 Subject: [Melbourne-pm] April 14 Perl Mongers Meeting! In-Reply-To: References: <4BC4075F.4060905@internode.on.net> <4BC4360D.9040703@perltraining.com.au> Message-ID: <4BC5130F.9070002@strategicdata.com.au> On 14/04/10 00:31, Patrick Donelan wrote: > It's just a small change, but the one I'm looking forward to the most > is finally getting rid of 'use strict' and 'use warnings' on 5.12. > > > Only strictures, not warnings I think? > > Adam would have a hernia if > they enabled warnings by default.. Meh, sounds like he is blaming warnings when maybe he should be looking at fixing the way his applications log to disk. Although I take his point about the confusion of working out just when warnings *are* enabled, now that assorted other modules (he mentions Moose, Mojo and Dancer) enable them for you. Which is why it will be best if there's a perl-core kind of way to do it. I'd like to see strict and warnings on by default, because of the number of times I've fixed up a friend or colleague's code that doesn't work - and it was for an obvious reason, yet they weren't running with strictures or warnings and so didn't get told by the interpreter. If you're an expert, then you can do 'no strict/warnings' where necessary, but generally I think they should start on. I realise I'm probably in the minority here though.. From pjf at perltraining.com.au Tue Apr 13 18:29:40 2010 From: pjf at perltraining.com.au (Paul Fenwick) Date: Wed, 14 Apr 2010 11:29:40 +1000 Subject: [Melbourne-pm] Perl Mongers Social, TONIGHT, 6pm, The Workshop Message-ID: <4BC51A84.2090102@perltraining.com.au> G'day Everyone, Tonight is a social Perl Mongers meeting. I'm listing the start time as a little earlier than normal (6pm rather than 6:30pm) since it's a social meeting. You can turn up earlier or later if you like. ;) Perl Mongers Social TONIGHT, 6pm The Workshop Bar ( http://theworkshop.com.au/ ) Level 1, 413 Elizabeth St, Melbourne (entrance on A'Beckett St) Map: http://tinyurl.com/y53725o The Workshop was food, beer and cider on tap, and has free wifi. I have no idea about power points. I *might* have an external battery capable of juicing 16V and 19V Dell, HP, and Asus laptops (which are most of the ones that aren't netbooks). It may or may not be charged by the time Alec arrives. ;) If you're having trouble finding us, you can call me on 03 9354 6001 which will call whatever phone I'm near at the time. :) See you there! Paul -- Paul Fenwick | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia | Fax: +61 3 9354 2681 From daniel at rimspace.net Tue Apr 13 18:38:55 2010 From: daniel at rimspace.net (Daniel Pittman) Date: Wed, 14 Apr 2010 11:38:55 +1000 Subject: [Melbourne-pm] April 14 Perl Mongers Meeting! In-Reply-To: <4BC5130F.9070002@strategicdata.com.au> (Toby Corkindale's message of "Wed, 14 Apr 2010 10:57:51 +1000") References: <4BC4075F.4060905@internode.on.net> <4BC4360D.9040703@perltraining.com.au> <4BC5130F.9070002@strategicdata.com.au> Message-ID: <87k4saizio.fsf@rimspace.net> Toby Corkindale writes: > On 14/04/10 00:31, Patrick Donelan wrote: >> It's just a small change, but the one I'm looking forward to the most >> is finally getting rid of 'use strict' and 'use warnings' on 5.12. >> >> >> Only strictures, not warnings I think? >> >> Adam would have a hernia if >> they enabled warnings by default.. > > Meh, sounds like he is blaming warnings when maybe he should be looking at > fixing the way his applications log to disk. Well, to some degree. Some of the strictness and warnings bits are too prone to false-positives, and those suck. > Although I take his point about the confusion of working out just when > warnings *are* enabled, now that assorted other modules (he mentions Moose, > Mojo and Dancer) enable them for you. Which is why it will be best if > there's a perl-core kind of way to do it. *nod* > I'd like to see strict and warnings on by default, because of the number of > times I've fixed up a friend or colleague's code that doesn't work - and it > was for an obvious reason, yet they weren't running with strictures or > warnings and so didn't get told by the interpreter. I am in favour of most of strict and some of warnings by default; a few bits of 'strict refs' like the '@{ $foo || [] }' noise I could live without, since I don't think they add substantial value, but other parts like magic call-by-name stuff I am happy to see remain. > If you're an expert, then you can do 'no strict/warnings' where necessary, > but generally I think they should start on. > > I realise I'm probably in the minority here though.. I think you are spot-on: being able to tell the system "lemme do it anyway", but providing more safety and, essentially, coddling to developers is a good thing. After all: computers are *good* at repetitive, boring tasks like checking if you misuse a variable, or typed in the wrong name, or whatever. People are absolutely, without question, *not* any good at that. So, let us pay the computer to do that hard work and warn us. Daniel I would actually like more static warnings and errors out of Perl, so that I could get compile-time warnings about calls to unknown functions ? and the option to disable those in the rare cases that code does dynamically extend the symbol table with new code at runtime. -- ? Daniel Pittman ? daniel at rimspace.net ? +61 401 155 707 ? made with 100 percent post-consumer electrons From toby.corkindale at strategicdata.com.au Tue Apr 13 18:45:51 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 14 Apr 2010 11:45:51 +1000 Subject: [Melbourne-pm] April 14 Perl Mongers Meeting? In-Reply-To: <31959615.13374.1271203509202.JavaMail.seven@ap6.p8.sca.7sys.net> References: <31959615.13374.1271203509202.JavaMail.seven@ap6.p8.sca.7sys.net> Message-ID: <4BC51E4F.2060500@strategicdata.com.au> On 14/04/10 10:05, alecclews at gmail.com wrote: > my laptop battery is cactus so if the lounge has power...... But sounds best so far I should really do some more work on my http://drinks.dryft.net/ site. It needs some way for users to leave comments and tag venues with things like "wifi" or "power" or "obnoxious bouncers". Also, some way of not looking like it was designed by a programmer who is terrible at making pretty websites :) From toby.corkindale at strategicdata.com.au Tue Apr 13 23:14:31 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Wed, 14 Apr 2010 16:14:31 +1000 Subject: [Melbourne-pm] Perl Mongers Social, TONIGHT, 6pm, The Workshop In-Reply-To: <4BC51A84.2090102@perltraining.com.au> References: <4BC51A84.2090102@perltraining.com.au> Message-ID: <4BC55D47.4010504@strategicdata.com.au> On 14/04/10 11:29, Paul Fenwick wrote: > The Workshop was food, beer and cider on tap, and has free wifi. I have just been (unreliably) informed that the Workshop cuts off the free wifi in the evenings, to stop people in the apartments over the road from leeching. Hmph :/ Then again, maybe they'd turn it back on again if asked nicely.. (Although really, surely a daily password would suffice?) From alfiejohn at gmail.com Sun Apr 18 18:12:41 2010 From: alfiejohn at gmail.com (Alfie John) Date: Mon, 19 Apr 2010 11:12:41 +1000 Subject: [Melbourne-pm] OSDC tonight? Message-ID: Hey folks, I know there is a OSDC AGM tonight, but are there going to be any talks? I haven't heard otherwise. Alfie -------------- next part -------------- An HTML attachment was scrubbed... URL: From toby.corkindale at strategicdata.com.au Wed Apr 21 22:59:23 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Thu, 22 Apr 2010 15:59:23 +1000 Subject: [Melbourne-pm] map -- with an iterator Message-ID: <4BCFE5BB.7080308@strategicdata.com.au> Hey all, You're all familiar with the map operator, used like so: my @results = map { transform $_ } @input; However I often find that instead of @input, I have $iterator, where $iterator is an object supporting a ->next method. What I would like to be able to do is something like: my @results = map { transform $_ } $iterator; and then have map walk through my iterator for me. Or even better, I'd like to be able to have: my $results = map { transform $_ } $iterator; where $results is an object supporting a ->push or ->add method of some sort. Twisting things around, I could see this being more of a feature of $iterator.. ie. so you could do: my @results = $iterator->map(sub { transform $_ }); I wondered if there are any modules floating around that can be used to map on top of the $iterators to add things like 'map', 'filter', 'foreach', etc to them? ie. So I could go: my $iterator = Third::Party::Module->foo; use_magic_wand($iterator); $iterator.foreach(sub { action $_ }); Cheers, Toby (Who may have been unduly influenced by Scala lists) From toby.corkindale at strategicdata.com.au Thu Apr 22 00:39:32 2010 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Thu, 22 Apr 2010 17:39:32 +1000 Subject: [Melbourne-pm] map -- with an iterator In-Reply-To: <20100422065428.GA13778@lxdev.armaguard> References: <4BCFE5BB.7080308@strategicdata.com.au> <20100422065428.GA13778@lxdev.armaguard> Message-ID: <4BCFFD34.2060106@strategicdata.com.au> On 22/04/10 16:54, Sam Watkins wrote: > On Thu, Apr 22, 2010 at 03:59:23PM +1000, Toby Corkindale wrote: >> Hey all, >> You're all familiar with the map operator, used like so: >> >> my @results = map { transform $_ } @input; >> >> >> However I often find that instead of @input, I have $iterator, >> where $iterator is an object supporting a ->next method. >> >> >> What I would like to be able to do is something like: >> my @results = map { transform $_ } $iterator; >> and then have map walk through my iterator for me. > > ok, how about this: > > #!/usr/bin/perl > use strict; use warnings; > > sub mapit (&$) { > my ($sub, $it) = @_; > my @out; > while (defined (my $x = $it->next)) { > push @out, $x; > } > return @out; > } > > my $it = It->new; > > my @out = mapit { $_ . "foo" } $it; > > print "@out\n"; > > package It; > > sub new { > return bless {x=>5}; > } > > sub next { > my ($self) = @_; > my $x = $self->{x}--; > return $x>= 0 ? $x : undef; > } Ah, the idea of having the iterator-aware map was to prevent creating a temporary array containing everything in the iterator. Eg. Say that the iterator returns a 10 Mbyte object every time you call ->next, and that you have one million items to get through. If you have to put them all into a temporary @out array first, then you chew up vast amounts of ram. Whereas if your iterator/map combo is smarter, then you only use 10 Mb at a time. (If you accumulating results, then you'll still build up an array of results, of course. But it might be a lot smaller.. or at the very least, it's only one copy of the results, not two.) So, currently one tends to do: while (my $item = $iterator->next) { do_stuff_to($item); } But it would be nice, syntactically, to say $iterator->foreach(sub { do_stuff($_) }); From shlomif at iglu.org.il Thu Apr 22 01:17:31 2010 From: shlomif at iglu.org.il (Shlomi Fish) Date: Thu, 22 Apr 2010 11:17:31 +0300 Subject: [Melbourne-pm] map -- with an iterator In-Reply-To: <4BCFFD34.2060106@strategicdata.com.au> References: <4BCFE5BB.7080308@strategicdata.com.au> <20100422065428.GA13778@lxdev.armaguard> <4BCFFD34.2060106@strategicdata.com.au> Message-ID: <201004221117.31893.shlomif@iglu.org.il> On Thursday 22 Apr 2010 10:39:32 Toby Corkindale wrote: > On 22/04/10 16:54, Sam Watkins wrote: > > On Thu, Apr 22, 2010 at 03:59:23PM +1000, Toby Corkindale wrote: > >> Hey all, > >> > >> You're all familiar with the map operator, used like so: > >> my @results = map { transform $_ } @input; > >> > Eg. Say that the iterator returns a 10 Mbyte object every time you call > ->next, and that you have one million items to get through. > > If you have to put them all into a temporary @out array first, then you > chew up vast amounts of ram. Whereas if your iterator/map combo is > smarter, then you only use 10 Mb at a time. (If you accumulating > results, then you'll still build up an array of results, of course. But > it might be a lot smaller.. or at the very least, it's only one copy of > the results, not two.) > > So, currently one tends to do: > while (my $item = $iterator->next) { > do_stuff_to($item); > } > > But it would be nice, syntactically, to say > $iterator->foreach(sub { do_stuff($_) }); > I'm not sure you can do that while calling your method "foreach" (because foreach is a reserved keyword.), but you can do it while calling it "for_" for example : [code] # Untested sub for_ { my $self = shift; my $callback = shift; while (my $item = $iterator->next()) { local $_ = $item; $callback->($item); } } [/code] There are some modules for implementing iterators like that on CPAN: * http://search.cpan.org/dist/Pipe/ * http://search.cpan.org/dist/HOP-Stream/ Regards, Shlomi Fish -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ What does "Zionism" mean? - http://shlom.in/def-zionism Deletionists delete Wikipedia articles that they consider lame. Chuck Norris deletes deletionists whom he considers lame. Please reply to list if it's a mailing list post - http://shlom.in/reply . From david.tulloh at AirservicesAustralia.com Thu Apr 22 01:18:25 2010 From: david.tulloh at AirservicesAustralia.com (Tulloh, David) Date: Thu, 22 Apr 2010 18:18:25 +1000 Subject: [Melbourne-pm] map -- with an iterator In-Reply-To: <4BCFFD34.2060106@strategicdata.com.au> References: <4BCFE5BB.7080308@strategicdata.com.au><20100422065428.GA13778@lxdev.armaguard> <4BCFFD34.2060106@strategicdata.com.au> Message-ID: > So, currently one tends to do: > while (my $item = $iterator->next) { > do_stuff_to($item); > } > > But it would be nice, syntactically, to say > $iterator->foreach(sub { do_stuff($_) }); You should be able to add a foreach member to the iterator class to enable this. Something like: sub foreach { my ($this, $coderef) = @_; while (my $item = $this->next) { &$coderef($item); } } $iterator->foreach( sub { say "Hi" } ); Same basic process, but hidden. Or the process from your original email was my $iterator = Third::Party::Module->foo; use_magic_wand($iterator); $iterator.foreach(sub { action $_ }); Where use_magic_wand is to subclass $iterator. David http://david.tulloh.id.au/