How to create portable web application in Perl

How to create portable web application in Perl

I'm Yuki kimoto, Japanese perl programmer.

I like creating web application by perl.
I release GitPrep a few weeks ago.

This is very portable web application and inatallation is easy.
Requirement is only Perl 5.8.7.
What technology is used?
I explain a little.

GitPrep(Github)

cpanm

cpanm is very good. cpanm can specify module version in cpanfile.

this is cpanfile.

    requires 'DBI', '== 1.625';
    requires 'DBD::SQLite', '== 1.37';
    requires 'Object::Simple', '== 3.09';
    requires 'DBIx::Custom', '== 0.28';

And I prepare setup.sh. this is automatically setup script for application.

Build Something People Want

A while back I said "just build something”. That was a bit of a lie. You need to build something people want. Don’t be the one who builds something s/he thinks people want. Make sure. Do you want it? Are you building it for someone who will use it immediately? Do you work somewhere that could use it if it existed? Do some basic market research. If you build something people want, then you’re already on your way to success.

[From my blog.]

Installing Term::ReadLine::Gnu on OS X, the easy way

If you try to install Term::ReadLine::Gnu on Mac OS X, you will ordinarily run into this unpleasantry from the Makefile.PL (which will likely end up in such as ~/.cpanm/build.log):

The libreadline you are using is the libedit library. Use the GNU Readline Library.

Here I will assume that you are using Homebrew and have installed GNU Readline:

brew install readline

Even so, you will get this error. This is because of how Homebrew installs Readline. Since OS X ships libedit as libreadline, Homebrew tries to avoid conflicts with system software by installing Readline as “keg-only” software – that is, it’ll install it within its package-managed filesystem hierarchy beneath /usr/local/Cellar, but it won’t link the libraries into /usr/local/lib, so that they won’t be visible to software that isn’t explicitly linked against it.

There is an easy and obvious way around this:

Update on the licenses and the repository links on CPAN

In December 2012 I checked how many Perl modules on CPAN have license information, and link to their repository in their META files. Later, in February 2013, I published an update.

Today I checked the 1,000 most recently uploaded modules again:

DateHas licenseHas repository link
December 201282.6%49.6%
February 201383.4%49.7%
July 201387%60.1%

It's a nice improvement, but remember these are the 1,000 most recent uploads. The percantages would be a lot lower if we looked at all the packages currently on CPAN.
I think both of these numbers should be around 99.7%.

If you'd like to check your module, you can use the metacpan_meta.pl 1000 PAUSEID command with you PAUSEID after installing MetaCPAN::Clients. That will show the 1000 most recent upload for the given PAUSEID. Even if some of them were 5 years ago. It will also show the list of offending distributions.

If you'd like to update them, here are two articles I wrote showing how to make that happen:
link to repository and add license field to META files.

The grep test - my personal experience

Possible you've read the grep test, particularly if you read Hacker News. The premise of "the grep test" is that if you write code that is not greppable, you fail "the grep test". Whether or not this is a good thing is a matter of debate, but here's my experience.

APIs and Marketing

If you are a software developer and have created or are creating a start-up, then please do not forget about building a web services API. Not only will it be an excellent way to build out a web site and connect mobile clients, but a web services API can be an excellent marketing tool. 

The API allows other people to build their own stuff on top of your API. Sometimes these will just be hobbyists playing around, but those hobbyists can be an excellent marketing tool as they’ll likely write blog posts and release their source code out on GitHub, or elsewhere. In addition, businesses may tie into your service, which is not only an additional source of revenue, but they’ll likely tout their integration with you on their web site. 

[From my blog.]

Crowdsourcing self-confidence

Update 12 hours later

I received a massive amount of feedback: here, on the mailing list and in private email. I humbly thank all of you for the many words of encouragement. I am planning to summarize in more detail what I took away from this in a separate post soon (once I am back from an internetless trip this weekend).

Original Text

TL;DR - There is this thing called DBIx::Class . It has a number of users, and a number of staunch non-users, which is all fine. Bottom line - it seems to be relatively important . For good AND for bad, I happen to be an integral part of this project for nearly 5 years. A number of my friends (who badgered me into writing this) believe that I am in a relatively unique position to "to boldly take this project where no ORM has gone before". Furthermore I am at a life-junction where I indeed

Overheard on stackoverflow

Commenter: why did you comment out use strict;?

OP: because i was getting errors and warnings because not all variables are defined as "my" or "our". it is for testing purposes only. I will uncomment that line later when the script works.


No link to protect the innocent.

jam - glue between pinto and scm

Pinto is great and helps create custom repositories of cpan packages, tune dependencies and get vital information about your distributions. One thing I lack is to propagate changes in source control as new distributions in pinto stacks and also new distributions for production servers. So this why I have created tool named "jam". Now it's in prototype stage, but it give a sense the way of automation.

One have list of code sources with changes get pulled from scm triggering new distributions holding changes and new distribution of application, dependent on those new ones. This processes get automated by jam. All you need - install pinto and jam, checkout sources and set configuration file:

Keeping It Simple (... and not being stupid)

I have never been a fan of Perl's operator overloading support, not only is the API kind of awkward, but the functionality is limited and fairly inflexible (at least compared to other languages like OCaml and Scala). But that said, I felt it was important to have some support for it in the new p5-mop.

Using Moose Metadata

As many of you know, the Moose module has a metaobject protocol, but it's not something that many casual hackers use. Truth be told, I don't use it a lot either, but when I do, it saves me a lot of hassle. I've been writing an extremely complicated data importer and at the end, I didn't so much need a summary of the data, but a summary of what the importer did. That's when Moose metadata made my life so much easier and my code more maintainable.

A Look at Conditional Compiling of Diagnostics

Is it possible to have conditionally compiled diagnostics in your script and to ensure they don't get printed in production?

Yes, it is.

GitPrep is git repository viewer on top of Perl and Mojolicious

I released GitPrep a few weeks ago.

GitPrep - Github clone. you can install portable github system into unix/linux.

This is github clone. you can install portable github system into unix/linux.

We konw gitweb.cgi, but this is a little difficult to use, and GitHub become defact standard.
User is happy to use GitHub interface when he create private repository on the server in company.

Perl and Mojolicious is great. GitPrep can work in both CGI and prefork built-in server and PSGI. You can use GitPrep uploading shared rental server as CGI script.

GitLab is difficult to install. but GitPrep is easy to install. requirement is only Perl 5.8.7.
Mojolicious need perl 5.10.1 but mojo-legacy project need Perl 5.8.7.

mojo-legacy author is jamadam. he is Japanese programer.

GitPrep is useful to see git repository on your server. Enjoy!

Fiddling with the metacpan.org URLs

One of the pain points of MetaCPAN is that URLs don't always point where you would expect them to. For example, should a script be found under metacpan.org/module/*? Does that make sense? What happens when someone releases a module with the name of the script? Please note that we're talking about the URLs on the search front end, not the API.

We've struggled for a long while with questions like this. How do we structure URLs on metacpan.org which have a sensible hierarchy? URLs (like version numbers) should be boring -- we don't want them to offer any surprises.

The bulk of the discussion on this topic can be found in this issue. However, if you want to weigh in on this without wading through the entire discussion, hop down to this comment and start from there.

Hacktivity report (Apr-Jun 2013)

Previous reports: Jan-Apr 2013, 2012 year-end, ...

Or should I say lack thereof. This period witnessed some rather major change in my personal life. I got married and moved to an apartment. So between the preparation for the wedding, the honeymoon, and the moving, there was little time and attention for long sessions of hacking.

What I managed to do is release minor updates for some of my CPAN modules:

What's the difference between arrays and lists?

One of the most common sources of confusion for new Perl programmers is the difference between arrays and lists. Although they sometimes look similar, they are very different things, and many bugs and misunderstandings are caused by not having a full understanding of the differences. Even experienced Perl programmers sometimes think arrays and lists are the same, but they are quite different in several important ways.

Read more at my blog: Arrays vs. Lists in Perl: What's the Difference?

I'd also love to hear if you can think of any examples that I didn't cover.

p5-MOP gets p6 style traits (sorta)

So the other day in #p5-mop we were discussing how to handle meta layer extensions. For example, doing things like adding accessor generation support to attributes.

class Foo {
    has $foo ( is => 'ro' );
}

The traditional approach found in the old p5-mop and in Moose was to do this by subclassing things in the metaclass or applying roles to the existing metaobjects (as is the favored approach with Moose). But to be honest, this approach is kind of tedious and often ends up requiring a lot of subclassing and mucking about.

So, in the grand tradition of stealing cool stuff from Perl 6 for use in Perl 5, we did just that (kinda sorta).

the first productive days with Pinto

After a while I could convince our admin at $work to prepare a virtual machine for running a Pinto server inside our company network. The primary goals were to have a well-known set of CPAN distributions available for installing developer machines, for running CI tests and for provisioning all kinds of servers.

New feature: automatic post truncation

Good news, everyone!

As authors on this site, you no longer need to be diligent about breaking your posts out among the misleadingly-named “body” and “extended” tabs of the new-entry screen. From now on, the front page will automatically truncate posts at a certain length, whether or not you thought to designate a section to place above the jump.

As readers, some of you have complained of unwittingly uncooperative authors in the past. You can now rest easy – this irritation is forever banished to history, and the front page will henceforth always be easily scannable.

Either way, you can now relax and enjoy your stay a little better.

PS.: the logic places the threshold at 225 words, but the exact cut-off point depends on your markup.

Data::Dumper::GUI

Everyone knows all that command-line stuff is for weirdo geeks, right? ;-) So let's bring Data::Dumper kicking and screaming into the 21st century and give it a pretty GUI!

ddGUI.png

Introducing Data::Dumper::GUI; a GUI for Data::Dumper. It allows you to view your data structures as a tree with collapsible nodes. Data::Dumper::GUI is built using Prima (a rather nice GUI toolkit designed specifically for Perl, that supports Win32 and X11, with no dependencies and compiles pretty quickly... for a GUI toolkit) and Moo.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.