From jarich at perltraining.com.au Mon Jun 3 19:36:12 2013 From: jarich at perltraining.com.au (Jacinta Richardson) Date: Tue, 04 Jun 2013 12:36:12 +1000 Subject: [Melbourne-pm] What's new in Perl 5.18? In-Reply-To: <51AD4C4A.6080805@perltraining.com.au> References: <51AD4C4A.6080805@perltraining.com.au> Message-ID: <51AD529C.80009@perltraining.com.au> As announced recently, Perl 5.18 is out. You might be wondering what has changed? Well yesterday I wrote a Perl tip on all the changes that I thought were interesting. I've included it below. I'm also running a Programming Perl course in Melbourne in two weeks time (17th - 21st June). I'm currently offering a discount of $500 per person, or $750 per person for bookings of 3 or more attendees (for bookings made by 3pm Friday 7th). Contact me for more information. All the best, Jacinta ==== What's new in 5.18.0? ==== Perl 5's yearly release rhythm is well established. Because major releases come out every single year, a major release no longer introduces a slew of new features. Instead, it consists of a smaller set of features and bug fixes. Upgrading to a new major version is easier than it's ever been. On 18th May 2013, Perl 5.18.0 was released. What has changed? == More information == In addition to this tip you may find it useful to read (http://search.cpan.org/dist/perl-5.18.0/pod/perldelta.pod) the perldelta document as well as our earlier tip on (http://perltraining.com.au/tips/2012-08-08.html) What's New in 5.12, 5.14 and 5.16 == Smart-match, given/when, lexical $_ all moved to experimental == There's now a new warnings category called "experimental". If you use an experimental feature without disabling that warning, you'll be told it's experimental. This allows developers to introduce new ideas and see whether they end up with unexpected consequences. Things that work will be removed from being experimental in a later release. On the other hand, some ideas that have ended up with much confusion have been marked as experimental until this confusion is clarified. Due to various special-casing, smart-match (and given/when as a result) and separately, lexical $_ have been marked as experimental. Turn off these warnings with the following: no warnings "experimental::smartmatch"; no warnings "experimental::lexical_topic"; or no warnings qw(experimental::smartmatch experimental::lexical_topic); The special warnings IDs for each experimental feature, are included with their warnings in (http://search.cpan.org/dist/perl-5.18.0/pod/perldiag.pod) perldiag. == Hash overhaul == In brief, hash ordering is now actually random for all hashes (as we've been told for a long while, but which hasn't always been strictly the case). Thus: my %hash1 = ( a => 1, b => 2, c => 3); my %hash2 = %hash1; say join " ", keys %hash1; say join " ", keys %hash2; would have previously printed out identical key ordering for both hashes during each program run. This will no longer occur. == Unicode == Perl now supports Unicode 6.2. You can also define your own names for characters for use in ``\N{}'', although if you begin a name with a digit or include commas in the name etc, then that's a syntax error. = Set operations = You can do set operations (such as intersection) within regular expressions character classes, for example: no warnings "experimental::regex_sets"; /(?[ \p{Thai} & \p{Digit} ])/ will match all the characters that are in the Thai script and are also digits. It's experimental, so you may want to turn the warning off. Sets can be combined further: /(?[ ( \p{Thai} + \p{Lao} ) & \p{Digit} ]) The union of Thai and Lao scripts intersected with digits gives us all digits in Thai and Lao scripts. See more at (http://search.cpan.org/~rjbs/perl-5.18.0/pod/perlrecharclass.pod# Extended_Bracketed_Character_Classes ) perlrecharclass. == $^{LAST_FH} == Should you ever want access to most recently read filename, you can now use $^{LAST_FH} # read a line from a random (hopefully opened) file handle my $string = < $file_handles[ rand @file_hands ] >; # oops, too short, let's add another line from that file, too if( length $string < MAX_LEN ) { $string .= < $^{LAST_FH} >; } == Lexical subroutine == It's been possible to create lexical subroutines of a type using subroutine references: my $sub = sub { ... }; $sub->(); Now it's possible (experimentally) to create lexical, shared and static subroutines directly that are only available within the appropriate scope and only after that declaration: no warnings "experimental::lexical_subs"; use feature 'lexical_subs'; my sub lexical { ... } our sub shared { ... } state sub static { ... } For more check out (http://search.cpan.org/~rjbs/perl-5.18.0/pod/perlsub.pod# Lexical_Subroutines ) perlsub. == Neat fixes == = qw(...) can no longer be used as parentheses = You can no longer write: foreach my $foo qw(a b c d e) { ... } you must now enclose the ``qw()'' within quotes: foreach my $foo ( qw(a b c d e) ) { ... } = require dies for unreadable files = Previously if you attempted to ``require'' a file and there wasn't a readable file of that name in your specified location, ``require'' would ignore the file and search @INC. Now it does not. == Other things == There are a few module changes, deprecations and selected bug-fixes as well. Check the (http://search.cpan.org/dist/perl-5.18.0/pod/perldelta.pod ) perldelta document for more. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alfiej at opera.com Tue Jun 4 19:30:37 2013 From: alfiej at opera.com (Alfie John) Date: Wed, 05 Jun 2013 12:30:37 +1000 Subject: [Melbourne-pm] Meeting - Wednesday the 12th of June, 2013 Message-ID: <1370399437.16357.140661239990333.5569B3C8@webmail.messagingengine.com> Hello Perl Mongers, The next Melbourne Perl Mongers meeting will be on Wednesday the 12th of June, 2013 and will start around 6:30pm: Opera Software Level 1, 91-97 William Street Melbourne CBD Ron Savage will be giving a talk on Marpa Release 2. Marpa parses any language whose grammar can be written in BNF. That includes recursive grammars, ambiguous grammars, infinitely ambiguous grammars and grammars with useless or empty productions. If anyone else would like to give a talk, feel free to email the list. Alfie -- Alfie John alfiej at opera.com From toby.corkindale at strategicdata.com.au Thu Jun 6 18:32:23 2013 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Fri, 07 Jun 2013 11:32:23 +1000 Subject: [Melbourne-pm] OSDC CFP extended to 08 July Message-ID: <51B13827.30909@strategicdata.com.au> Hi, I received this message from the OSDC organisers, including the wacky indenting I reproduced below. We are loving the submissions that are coming through, but we still want MORE! Our focus this year is security, identity and privacy. We need YOU as a presenter! Your pet project, what you?re currently working on, what you?d like to work on. You've got a great idea in your head, and and we would like you to speak about it at OSDC2013 Auckland. Perhaps someone has suggested that you submit a proposal because they're impressed with what you've been doing, or perhaps you've given talks at other conferences or events and you'd like to give one here. Perhaps you're a repeat speaker, or at least a repeat proposal-submitter and you want some hints on how to make it much more likely your talk will be accepted. Now you need to read Jacinta Richardson?s document on how to submit a presentation.[1] Your presentation should be either 30 or 45 minutes. Please email your submission to papers at osdc.org.nz. CFP closes 08 July. Have fun! Visit www.osdc.org.nz for registration and information. Best regards The OSDC2013 team [1: http://osdcnz.wordpress.com/need-to-know/getting-your-conference-abstractproposal-accepted/ ] From toby.corkindale at strategicdata.com.au Thu Jun 6 18:42:28 2013 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Fri, 07 Jun 2013 11:42:28 +1000 Subject: [Melbourne-pm] Meeting - Wednesday the 12th of June, 2013 In-Reply-To: <1370399437.16357.140661239990333.5569B3C8@webmail.messagingengine.com> References: <1370399437.16357.140661239990333.5569B3C8@webmail.messagingengine.com> Message-ID: <51B13A84.1050500@strategicdata.com.au> On 05/06/13 12:30, Alfie John wrote: > Hello Perl Mongers, > > The next Melbourne Perl Mongers meeting will be on Wednesday the 12th of > June, 2013 and will start around 6:30pm: > > Opera Software > Level 1, 91-97 William Street > Melbourne CBD > > Ron Savage will be giving a talk on Marpa Release 2. Marpa parses any > language whose grammar can be written in BNF. That includes recursive > grammars, ambiguous grammars, infinitely ambiguous grammars and grammars > with useless or empty productions. > > If anyone else would like to give a talk, feel free to email the list. Be aware that you can RSVP or spread the word about these events, if you wish, at various locations online: http://www.meetup.com/Melbourne-Perl-Mongers/events/117932702/ https://www.facebook.com/events/175216672645900/ https://plus.google.com/u/1/events/cumbsoso54bmlktd9bskq5dvmvg From scottp at dd.com.au Thu Jun 6 18:54:59 2013 From: scottp at dd.com.au (Scott Penrose) Date: Fri, 7 Jun 2013 11:54:59 +1000 Subject: [Melbourne-pm] Dancer: index.html Message-ID: Hi Perl Mongers Anyone familiar with Dancer and public files? In production, my public files are delivered by Apache, which means I can go to /fred/ and get actually /fred/index.html. But when I run in Dancer and go to /fred/ I have to specifically enter /fred/index.html. I can easily add a rule for each of my directories, but that is a bit of a pain. Is there any way to add configuration so public (static) content automatically looks for index.html? Ta Scott P.S. If not, I guess it could be done with an even on the 404. ie if 404, try adding index.html to the end and retry. From scottp at dd.com.au Thu Jun 6 22:30:13 2013 From: scottp at dd.com.au (Scott Penrose) Date: Fri, 7 Jun 2013 15:30:13 +1000 Subject: [Melbourne-pm] Dancer: index.html In-Reply-To: References: Message-ID: FYI - worked around my problem with a couple of hooks. get '/X/' => sub { send_file "/X/index.html"; }; get qr{^/X/(.+)/$} => sub { my ($name) = splat; send_file "/X/$name/index.html"; }; On 07/06/2013, at 11:54 AM, Scott Penrose wrote: > Hi Perl Mongers > > Anyone familiar with Dancer and public files? > > In production, my public files are delivered by Apache, which means I can go to /fred/ and get actually /fred/index.html. But when I run in Dancer and go to /fred/ I have to specifically enter /fred/index.html. > I can easily add a rule for each of my directories, but that is a bit of a pain. > > Is there any way to add configuration so public (static) content automatically looks for index.html? > > Ta > > Scott > P.S. If not, I guess it could be done with an even on the 404. ie if 404, try adding index.html to the end and retry. > _______________________________________________ > Melbourne-pm mailing list > Melbourne-pm at pm.org > http://mail.pm.org/mailman/listinfo/melbourne-pm From toby.corkindale at strategicdata.com.au Mon Jun 10 23:25:00 2013 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Tue, 11 Jun 2013 16:25:00 +1000 Subject: [Melbourne-pm] Module counts Message-ID: <51B6C2BC.4010608@strategicdata.com.au> I confess to not having seen this site before: http://modulecounts.com/ It's just a tracker for total number of packages on CPAN, and the equivalents for other languages' centralised repositories. These days, CPAN is ranked fifth, with the package sites for Java (Maven), Ruby (Gems), Python (PyPi) and Node.js (npm) all ranking higher. (Java and Ruby having more than double the number of CPAN packages!) In Perl's defence, it is claimed that CPAN packages are more mature and stable. ie. Quality over quantity. I haven't investigated to find out if that's true though. Does anyone here have experience with other sites who'd like to comment? Cheers, Toby From alfiej at opera.com Tue Jun 11 17:18:04 2013 From: alfiej at opera.com (Alfie John) Date: Wed, 12 Jun 2013 10:18:04 +1000 Subject: [Melbourne-pm] TONIGHT: Meeting - Wednesday the 12th of June, 2013 Message-ID: <1370996284.9512.140661242809457.4962C9EC@webmail.messagingengine.com> Hello Perl Mongers, The next Melbourne Perl Mongers meeting will be TONIGHT (Wednesday the 12th of June, 2013) and will start around 6:30pm: Opera Software Level 1, 91-97 William Street Melbourne CBD Ron Savage will be giving a talk on Marpa Release 2. Marpa parses any language whose grammar can be written in BNF. That includes recursive grammars, ambiguous grammars, infinitely ambiguous grammars and grammars with useless or empty productions. If anyone else would like to give a talk, feel free to email the list. Alfie -- Alfie John alfiej at opera.com _______________________________________________ Melbourne-pm mailing list Melbourne-pm at pm.org http://mail.pm.org/mailman/listinfo/melbourne-pm From scottp at dd.com.au Wed Jun 12 21:16:48 2013 From: scottp at dd.com.au (Scott Penrose) Date: Thu, 13 Jun 2013 14:16:48 +1000 Subject: [Melbourne-pm] Salesforce REST API Message-ID: Anyone with some experience with the salesforce REST API for some contracting hours (estimate about 10). All remotely. Ta Scott From greg.george at orica.com Wed Jun 12 21:29:58 2013 From: greg.george at orica.com (greg.george at orica.com) Date: Thu, 13 Jun 2013 14:29:58 +1000 Subject: [Melbourne-pm] Presentation slides on Graphviz & Marpa presentation by Ron Savage 12/06/2013 In-Reply-To: <1370996284.9512.140661242809457.4962C9EC@webmail.messagingengine.com> References: <1370996284.9512.140661242809457.4962C9EC@webmail.messagingengine.com> Message-ID: Details from Ron Savages presentation on Graphviz2 and Marpa http://savage.net.au/Ron/html/graphviz2.talk/ Regards, Greg George *********************************************************************************************************************************************************************************************** Please consider the environment before printing this e-mail. This message is intended solely for the individual(s) and entity(s) addressed. It is confidential and may contain legally privileged information. The use, copying or distribution of this message or any information it contains, by anyone other than the addressee, is prohibited. If you have received this message in error, please notify postmaster at orica.com. The mailbox address from which this message has been sent is for business mail only. Mail sent to it may be subject to security scanning and delivery on non-business messages sent to this address may not occur. Thank you. *********************************************************************************************************************************************************************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From toby.corkindale at strategicdata.com.au Fri Jun 21 01:06:23 2013 From: toby.corkindale at strategicdata.com.au (Toby Corkindale) Date: Fri, 21 Jun 2013 18:06:23 +1000 Subject: [Melbourne-pm] Moose/Moo type constraints Message-ID: <51C4097F.90206@strategicdata.com.au> Hi, I just wondered if there's a Moose constraint that checks the expected arguments of a coderef? ie. In the following program, it will die if you call $area_sub->() with anything other than a single, numeric, parameter. I just wondered if you can introspect that during the Moose object constructor, since the function has been defined using Moose types too and thus has that info available somewhere.. I have a suspicion the answer is "No" but I'm curious in case I missed this somewhere. use Method::Signatures; # This version should succeed: my $item = Object->new( x => 12, y => 34, radius => 6.99, area_calculator => func (Num r) { 3.14 * r * r } ); # This call should die with invalid argument exception: my $item = Object->new( x => 12, y => 34, radius => 6.99, area_calculator => func (Int age, Str name) { length(name) * age } ); package Object; use Moose; use Method::Signatures; has [qw(x y radius)] => ( is => 'ro', isa => 'Num', required => 1, ); has area_calculator => ( is => 'ro', required => 1, isa => subtype( 'CodeRef' => where { ... } ), ); method area { $self->area_calculator->($self->radius) } 1; From scottp at dd.com.au Thu Jun 27 21:47:05 2013 From: scottp at dd.com.au (Scott Penrose) Date: Fri, 28 Jun 2013 14:47:05 +1000 Subject: [Melbourne-pm] OSDC 2013 CFP - 1 more week Message-ID: <99B1E2DA-26F4-47CB-A5FD-D6824BD4947B@dd.com.au> Hi Melbourne Perl Mongers This is your fantastic opportunity to deliver a paper in another country... Grab this chance ! We are loving the submissions that are coming through, but we still want MORE! Our focus this year is security, identity and privacy. We need YOU as a presenter! Your pet project, what you?re currently working on, what you?d like to work on. You've got a great idea in your head, and and we would like you to speak about it at OSDC2013 Auckland. Perhaps someone has suggested that you submit a proposal because they're impressed with what you've been doing, or perhaps you've given talks at other conferences or events and you'd like to give one here. Perhaps you're a repeat speaker, or at least a repeat proposal-submitter and you want some hints on how to make it much more likely your talk will be accepted. Now you need to read Jacinta Richardson?s document on how to submit a presentation.[1] Your presentation should be either 30 or 45 minutes. Please email your submission to papers at osdc.org.nz. CFP closes 08 July. Have fun! Visit www.osdc.org.nz for registration and information. Best regards The OSDC2013 team -------------- next part -------------- An HTML attachment was scrubbed... URL: