Melbourne Perl Mongers/Meeting History 2010
12th May 2010, Perl 6, Sam's custom markdown
@dryfter demonstrated Perl6, plus some Go and Scala. We had a disappointing time with Perl6. Some Notes on Perl 6 came from it.
Sam Watkins discussed Formless, his custom markdown system, which generates web forms from tab-separated text files that can be edited in vim or a spreadsheet. It is a work in progress. He uses a similar program to generate his web site from text files such as this one, and using make to rebuild html files when the source files are modified. He intends to clean up the code and merge these two programs. Sam is working at Linfox Armaguard, and using Formless to help create web-apps.
we discussed several modules for retrying/attempting a repeated task.
@dryfter's method is available at:
Mark Fowler's Attempt was another one mentioned. Notably, his module is designed more to retry over and over quickly, whereas Retry increases the delay between retries, and has a callback to report on failures as they happen, in case you need to provide feedback to the user, or record it for error logging.
@alecthegeek outlined devops and the Sydney Devops Down Under Conference at which he presented.
@alecthegeek showed Getting Things Gnome at the pub
Hamish changed his prompt to be red on error (return code != 0). This helps detect failed commands and also helps in another case where you type a command then cancel it by pressing ctrl+c. Someone watching your terminal cannot easily tell that command was cancelled, especially if it is a command that would have no output on success (eg rf -f project_directory).
add the following to your .bash_profile:
- needs PS1 to be previously defined so add nearer the end of your .bashrc/.bash_profile
- will turn entire prompt red (31) or green (32)
- depending on previous output return code
export PS1="\[\e[\`if [ \$? = 0 ]; then echo '0;32m'; else echo '0;31m'; fi\`\]$PS1\[\e[0m\]"
14th April 2010, social meeting
This meeting was a social event, at the Workshop Bar http://theworkshop.com.au/ Level 1, 413 Elizabeth St, Melbourne (entrance on A'Beckett St).
10th March 2010, modern Perl techniques, cpanminus
The talks, pizza, camel cookies, people and the location were excellent. This was the first meeting at the new location, realestate.com.au.
Thanks to Jacinta, Paul, realestate.com.au, and all the Perl mongers for a fun and interesting night.
Jacinta Richardson: modern Perl techniques
- Module::Starter - creating CPAN-ready perl modules easily.
- you can choose which module builder to use
- configure with ~/.module-starter/config
- Module::Starter::PBP uses "Perl best practises"
- sets up some simple tests, using Test::More ...
- alternatives: Catalyst, ... (another was mentioned?)
- easy to write tests: use_ok, ok, is, isnt ...
- author tests
- test driven development - write test first, check they fail, then code
- bailout: don't run any more tests
- some other useful test modules:
- Test::Most - tabulated differences
- Test::TestCoverage - uses Devel::Cover, checks "am I testing everything?"
- Test::PerlCritic - tests "Perl best practises"
- Test::Delta - tests with floats, where there may be some rounding error
- a question about the -w flag, how is it different from "use warnings"?
- it enables warnings in all scripts, even libraries you use that don't have "use warnings".
- There is also -W "enable warnings with extreme prejudice" or something like that, which enables warnings everywhere even if the script says "no warnings"!
Paul Fenwick: local::lib, cpanminus
- a guideline for presentations: don't do live demos, and don't rely on the network - but Paul does both in this presentation!
- local::lib - installing CPAN modules without root, easier than configuring CPAN.pm
- App::cpanminus - installing CPAN modules quickly and easily
- no deps, zero-conf, standalone, logs to build.log
- wget http://xrl.us/cpanm
- tried it out on Task::Kensho ("half of cpan"), seems to work fine
- --sudo to build as user, install as root
- allegedly works on Windows too
- maybe needs a --yes option, to install optional deps
- perl -Mautodie -E'say autodie->VERSION';
- The -E turns on all new Perl 5.10 features such as "say", "state", "switch"; like "use feature :5.10"
- Strawberry Perl Professional "Padre" is currently in Beta.
- includes lots of CPAN modules that play well together on windows