MadMongers (Madison Perl Mongers)

MadMongers (Madison Perl Mongers) :

I have an idea for a year-long series of presentations for MadMongers. Come listen and share your thoughts.

[From my blog.]

Closures, alternatives, map in Perl 6

In a script I recently wrote, I employed a few features of Perl 6 that I'd like to highlight. I'm using Mash to create a distance matrix of samples (usually metagenomes or genomes) to each other, either in a complete pair-wise fashion or some set (like the Pacific Ocean Virome) to some new set of samples.

The output of Mash is a tab-delimited file. The first line contains the column headers, and the first column is the literal string "#query" followed by all the sample/file names which include the relative path information. Here is a sample:

Announcing Mojolicious::Command::generate::routes_restsful and Mojolicious::Command::generate::routes_restsful_just_routes

Get everything you need from just a hash

My recent release of Mojolicious::Plugin::Routes::Restful inspired my to go a little beyond and create code that generates code.

I have never been a big fan of this getting something from nothing idea

Heisenberg_14.jpeg

I guess I can't understand the math, after I discovered that 6 x 9 = 42, it never seems to come out right.

I have used auto-generated of course and have never been that pleased with it. I have spent many a week trying to make some silly shlock together out of Dreamweaver work with real code.

I have also seen a front end just slapped onto a dump of a DB schema that was created with DBIX Class Schema Loader and even worse the same but using JAVA's Hibernate. How about a level of abstraction between??

Perl 5 Porters Mailing List Summary: December 8th-11th

Hey everyone,

Following is the p5p (Perl 5 Porters) mailing list summary for the past half week.

Enjoy!

C::Blocks Advent Day 8

This is the C::Blocks Advent Calendar, in which I release a new treat each day about the C::Blocks library. Yesterday I showed one way to build a (mildly) complex data structure, including handling pointers and managing memory. Today I will explain how to tightly control access to pointers using classes and C::Blocks::Object::Magic.

C::Blocks Advent Day 7

This is the C::Blocks Advent Calendar, in which I release a new treat each day about the C::Blocks library. Yesterday I illustrated the many ways you generate or modify C source code. Today I discuss basic facilities for handling pointers and building C data structures.

The MAIN Thing

If you're coming to Perl 6 from Perl 5, the global variable @*ARGS will be familiar to you as the place to get the command-line arguments to your program:

$ cat main1.pl6
#!/usr/bin/env perl6

put "ARGS = ", @*ARGS.join(', ');
$ ./main1.pl6 foo bar baz
ARGS = foo, bar, baz

The @ is the sigil that denotes the variable as an array, and the * is the "twigle" that denotes that the variable is a global.  If you follow the above link to the documentation, you'll find a whole host of other dynamic and environmental variables like user, hostname, PID, cwd, etc.

Dealing directly with @*ARGS is fine your program accepts a few positional arguments where the first argument means one thing (name), the second argument another thing (rank), the third another (serial number), etc:

$ cat main2.pl6
#!/usr/bin/env perl6

my ($name, $rank, $serial-num) = @*ARGS;
put "name ($name) rank ($rank) serial number ($serial-num)";
$ ./main2.pl6 Patch Private 1656401
name (Patch) rank (Private) serial number (1656401)

C::Blocks Advent Day 6

This is the C::Blocks Advent Calendar, in which I release a new treat each day about the C::Blocks library. Over the last few days I have illustrated how to use C::Blocks to write procedural code, how to get data across the Perl/C divide, including using types to do that concisely, and how to write code that is shared across modules and scripts. Yesterday I provided some benchmarks that I hope give a sense for the performance of C::Blocks, and start to indicate the circumstances when it might be useful. Today I am going to illustrate the many ways you can generate and/or modify your C code using C::Blocks including source filters, interpolation blocks, and the good old string eval.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.