THE WORLD DISCUSSES #PYTHIAN ON TWITTER. HAVE A QUESTION? USE OUR HASHTAG AND ASK AWAY.

Perl Survey Results In.

Holy Zarquon just released the initial results of the 2010 Perl Survey.

The slides are also available.

Now for my 2cents worth.
Read the rest of this entry . . .

Shuck & Awe #6: Hunting for Perl

[yanick@enkidu shuck]$ perl -MFile::Find::Rule \
    -e'INIT{@ARGV=File::Find::Rule->file->name("*.news")->in("blogs")}'

Remember me mentioning David Wheeler‘s CPAN-like project for PostgreSQL? Well, by now it has an official name — PGXN — and the ball has now been set into motion. This is going to be good.

bingos decided to take the Dist::Zilla leap this week. A few plugins have already been churned out as the result.

Danger Will Robinson! If you are using File::chdir, David Golden warns that Perl 5.13.1 broke it by fixing a tied variable-related bug. Things are expected to be back to normal with Perl 5.13.2.

Read the rest of this entry . . .

Dist::Zilla autocomplete

Does anyone know of a Yak Shaving Anonymous association hackers addicted to shearing Tibetan bovines could join?

Anyway, here are two little things I hacked on top of Dist::Zilla that peeps might find useful.

The first, as hinted by the blog entry’s title, is a direct adaptation of Aristotle’s perldoc-complete for dzil.

$ dzil <tab>
build     install   new       plugins   rjbsver   smoke     xtest
clean     listdeps  nop       release   run       test

The second is actually the one that started that round of shaving for me. As there is about a gazillion Dist::Zilla plugins, I wanted to have a quick way to see all the plugins installed on a specific machine. Enter a new dzil sub-command: plugins.

Read the rest of this entry . . .

Wherever I May Roam

    Roamer, wanderer
    Nomad, vagabond
    Call me what you will

    $ENV{LC_ALL} = "anywhere";
    my $time = localtime;
    say {$anywhere} my $mind;
    local *anywhere = sub { ... };

    Anywhere I roam
    Where I 'git ghclone environment' is $HOME

        # 'grep may_roam($_) => @everywhere',
        #                with apologies to Metallica

Laziness and a severe addiction to yak shaving conspire to constantly make me tweak configurations and hack scripts to make my everyday editing / shell / development experience as holistic as possible. Unfortunately the same laziness, combined with my constant hopping between home and $work computers, severely gets in the way of effectively using those optimizations. Indeed, although I have those nifty toys installed here and there, because they are not uniformly installed everywhere I constantly find myself using the machines’ functional lowest common denominator.

Read the rest of this entry . . .

Shuck & Awe #3: Hunting for Perl

[yanick@enkidu shuck]$ echo "original json_pretty taken from hanekomu's tweet"
[yanick@enkidu shuck]$ cat news.json | perl -0007 -MJSON -nE"say for @{from_json(\$_)->{interesting}}"

Want to help Perl 6, and collect some booty in the process? Moritz Lenz has issued the first of a series of Perl 6 challenges. Fulfill the challenge, and get a chance to win mind-bogglingly fabulous prizes (well, okay, t-shirts for now). This week’s challenge doesn’t even require Perl 6 knowledge — it’s all about creating a website for proto.

Talking of Perl 6, masak announced the release of Yapsi, a Perl 6 compiler written in Perl 6.

Read the rest of this entry . . .

Shuck & Awe #2: Hunting for Perl

[yanick@enkidu shuck]$ tail -f news | perl -nE'say if /interesting/'

Huzzah! It’s official, Perl 5.12 is out! If you haven’t already, check out the changelog! As one might expect, this little piece of news made its way on several blogs, both internal and external to the Perl community.

Module authors, there are some other changes at the horizon for your modules’ META files as well. David Golden announced the release of version 2 of the CPAN META Spec. One of the biggest changes is the adoption of JSON (over YAML) as the preferred serialization format.

Plabo Marin-Garcias wrote about how to manage multiple local perl installations using perlbrew. If, for whatever reason, you have to juggle with more than one perl installation on the same machine App::perlbrew, written by Gugod, this might be a (gu)godsend that will make you sing hosannas for months to come…

In a nice little success story, chromatic tells us how Dist::Zilla, Github and Gitpan are helping to alleviate the complexity of distribution maintenance, turning what many consider a chore into… well, okay, still a chore, but at least a well-oiled, smoother one.

It’s a web framework smackdown! Adam Kennedy writes a series of articles in which he gets his feet wet with two modern Perl web frameworks:Mojolicious and Dancer.

All work and no play makes Jack a dull boy? No more! Kartik announced that the beloved game Frozen Bubble is now directly available on CPAN.

Sawyer X got fed-up of manually hunting for module versionsand created Module::Version to take care of the deed. Turned out he wasn’t the first to have that itch — in the comments people also recommended Module::Which and V.

On the microscopic side of things, garu shared a few shell aliases that will make your one-liner even tinier.

Tags. Everything taste better with tags. In consequence, Ovid presented a way to add tags to Test::Classtests.

Moose has a new website, Stevan Little reports. Because it’s not fun till it turns meta, the code producing the site is itself available via a git repository.

Finally, it looks like miyagawa went on a hacking frenzy. The result is Subana a cloud service that can run any Plack application.

^D
[yanick@enkidu shuck]$ perl -E'sleep 2 * 7 * 24 * 60 * 60 # see ya in 2 weeks!'

DBD::Oracle and Windows 64bit

I have successfully compiled and installed DBD::Oracle on Windows 2008 Server 64bit operating system today.

I used the latest version of DBD::Oracle 1.24, version 11.2.0.1.0 for 64bit Windows of Oracle’s
Instant Client Package – Basic along with the Instant Client Package – SQL*Plus and finally the Instant Client Package – SDK.

To get it to make and compile correctly I had to download Microsoft’s Visual Studio Ultimate

which should contain all the files you need. It is rather portly at 2+gb so you might want to grab lunch while you are downloading it.

After all the above downloading DBD::Oracle installed right out of the box.

All one has to do is select ‘Start Menu->All Programs->Microsoft Visual Studio 2010->Visual Studio Tools->Visual Studio x64 Win64 Command Prompt (2010)’
which will open a good old ‘dos’ window.

At this point CD to the directory where you downloaded DBD::Oracle

     c:\DBD-Oracle

then set your ‘ORACLE_HOME to the Instant Client directory

     c:\DBD-Oracle set ORACLE_HOME=c:\IC_11

you should also set your NLS like this

     c:\DBD-Oracle set NLS_LANG=.WE8ISO8859P15

Once the above setting are done do a

     c:\DBD-Oracle perl Makefile.PL

and then a

     c:\DBD-Oracle nmake install

Which will produce a whole of warnings (these you can ignore, as they do not seem to effect DBD::Oracle at all) and near the end it should output something like this;

     Generating code
     Finished generating code
     if exist blib\arch\auto\DBD\Oracle\Oracle.dll.manifest mt -nologo -manifest blib\arch\auto\DBD\Oracle\Oracle.dll.manifest -outputresource:blib\arch\auto
\DBD\Oracle\Oracle.dll;2
     if exist blib\arch\auto\DBD\Oracle\Oracle.dll.manifest del blib\arch\auto\DBD\Oracle\Oracle.dll.manifest
     C:\Perl64\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 blib\arch\auto\DBD\Oracle\Oracle.dll
     C:\Perl64\bin\perl.exe -MExtUtils::Command -e "cp" -- Oracle.bs blib\arch\auto\DBD\Oracle\Oracle.bs
     C:\Perl64\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 blib\arch\auto\DBD\Oracle\Oracle.bs
     C:\Perl64\bin\perl.exe "-Iblib\arch" "-Iblib\lib" ora_explain.PL ora_explain
Extracted ora_explain from ora_explain.PL with variable substitutions.
     C:\Perl64\bin\perl.exe -MExtUtils::Command -e "cp" -- ora_explain blib\script\ora_explain
        pl2bat.bat blib\script\ora_explain

At this point you are all done.

Well almost.

It is important that you test your code before you install but you will have to set a few things up first to get it to fully test correctly.

You will need a TNSNAMES.ORA file that points to a valid DB in the Instant Client Directory

Next you will need to set the ORACLE_USER_ID to a valid user

     c:\DBD-Oracle set ORACLE_USER_ID=system/system@XE

You will have to set up TNS_ADMIN to point to the Instant Client Directory

     c:\DBD-Oracle set TNS_ADMIN=c:\IC_11

Most importantly you will have to add the Instant Client directory to your path like this

     c:\DBD-Oracle path = c:\IC_11;%path%

If you do not do this step you will run into the dreaded

Can’t load ‘C:/Perl/lib/auto/DBD/Oracle/Oracle.dll’ for module DBD::Oracle: load_file:%1 is not a valid Win32 application at C:/Perl/lib/DynaLoader.pm line 202.

Error later on after the compile when you try to use DBD::Oracle.

What is actually going on is that Perl cannot find oci.dll (or one of the other .dlls it needs to run) the

C:/Perl/lib/auto/DBD/Oracle/Oracle.dll’ and the DynaLoader error

is just a false trail as perl is very limited in what it Windows errors it can report on. For more complet info on this sort of error check out this page;

Oracle Troubleshooter HOWTO

by Alexander Foken. It is rather dated but the facts of why perl did not find a dll are still valid.

now you can do this

     c:\DBD-Oracle nmake test

and all the tests should run and it will report.

Finally simply do a

     c:\DBD-Oracle nmake install

and you are all set.

That is about it.

At this point you might want to add the Instant Client directory permanently to your path so you will not run into the Dynaloader error again.

As well you do not need to keep Visual Studio around to use DBD::Oracle so you can uninstall that as well.

Shuck & Awe #1: Hunting for Perl

Welcome to the first issue of Shuck & Awe: Hunting for Perl. Inspired by Blogrotate and Log Buffer, I’ve decided to try jump-starting a bi-weekly review of everything and anything that caught our attention in the Perl world. Okay, that’s enough introduction. Let’s cut down to the meat already, and see what I’ve collected for the last two weeks.

First and foremost, Adam Trickett (ajt) trumpeted on, fittingly enough, Perl is Alive, that RC1 of Perl 5.12.0 is out. If you haven’t already, it’s time to read what shiny new toys 5.12 is bringing along. I don’t know about you, but I have the feeling I’ll be compiling myself a new perl this week-end…

In the same “still kicking strong” frame of mind, Ovid has posted a follow-up on his Perl 5 is Dying. If nothing else, the programming job trend graph he quotes is heart-warming for us Perl hackers.

It’s Spring! In a most seasonal spirit, brian d foy is calling upon CPAN authors to harken the call of Spring cleaning and tidy up their CPAN directory in an effort to boost the Schwartz ratio a wee bit.

Read the rest of this entry . . .

dpanneur – your friendly DarkPAN/CPAN proxy corner store

There were two things I have wanted to do for some time now. The first was to come up with a way to quickly and easily set up a DarkPAN mirror so that we would have more control over our dependency chain at work. The second was to make a portable CPAN proxy service, so that I can always have access to my favorite modules, even if the machine I’m working on has no Internet access. Last week, I finally had a few ‘rount tuits’ to spend on this type of background itch, and the result is dpanneur (for dépanneur, French Canadian for convenience store).

Installation

As it stands, dpanneur is a very thin Catalyst application gluing together the goodiness of CPAN::Cache and MyCPAN::App::DPAN, and throwing in Git as the archive manager.

To get it running, first fetch it from Github

$ git clone git://github.com/yanick/dpanneur.git

then check that you have all the dependencies

$ perl Makefile.PL

and run the script that will create the module repository

$ ./script/create_repo

For now, the module repository is hard-coded to be in the subdirectory cpan of dpanneur. A branch called proxy is created and checked out. Eventually, I’ll use GitStore to push newly fetched modules to the repository, but for the time being if dpanneur is to be used as a proxy, that branch must remain as the one being checked out.

All that is left is to fire up the server in whichever mode you prefer (single-thread test server would do nicely for now)

$ ./script/dpanneur_server.pl

and there you are, running your first dpanneur. Congrats! :-)

Using it as a caching proxy

You can use the server as a caching proxy, either for its own sake, or to seed the DarkPAN branches. To do that, you just have to configure your CPAN client to use http://yourmachine:3000/proxy:

$ cpan
cpan[1]> o conf urllist = http://localhost:3000/proxy
cpan[2]> reload index
cpan[3]> install Acme::EyeDrops
Running install for module 'Acme::EyeDrops'
Running make for A/AS/ASAVIGE/Acme-EyeDrops-1.55.tar.gz
Fetching with LWP:

http://localhost:3000/proxy/authors/id/A/AS/ASAVIGE/Acme-EyeDrops-1.55.tar.gz

etc..

As the modules are downloaded, they are also saved and committed within the repo

[dpanneur]$ cd cpan

[cpan (proxy)]$ git log -n 3
commit d065ad152f2204295334c5475104a3da517b6ae1
Author: Yanick Champoux <yanick@babyl.dyndns.org>
Date:   Wed Mar 10 20:32:52 2010 -0500

    authors/id/A/AS/ASAVIGE/Acme-EyeDrops-1.55.tar.gz

commit e8d2e83d1b16e2e0713d125f9a4bd2742681f859
Author: Yanick Champoux <yanick@babyl.dyndns.org>

Date:   Wed Mar 10 20:31:42 2010 -0500

    authors/id/D/DC/DCONWAY/Acme-Bleach-1.12.tar.gz

commit 7e0b4b600bac8424c519199ee96dc56ffbb177eb
Author: Yanick Champoux <yanick@babyl.dyndns.org>
Date:   Wed Mar 10 20:30:47 2010 -0500

    modules/03modlist.data.gz

Using it as a DarkPAN server

There is not much more involved to enabling DarkPAN repos. All we have to do is to create a branch with the modules we want and have the ‘dpan’ utility bundled with MyCPAN::App::DPAN generate the right files for us.

To continue with the example of the previous section, let’s say that we want a DarkPAN branch containing Acme::EyeDrops, but not Acme::Bleach. Then we’d do

                        # only necessary if you are running
                        # the server while you work on the branch
[dpanneur]$ git clone cpan cpan-work   

[dpanneur]$ cd cpan-work

                        # branch just before we imported Acme::Bleach
[cpan-work (proxy)]$ git branch pictoral 7e0b4b600bac8424c519199ee96dc56ffbb177eb

[cpan-work (proxy)]$ git checkout pictoral
Switched to branch 'pictoral'

                        # cherry-pick the Acme::EyeDrops commit
[cpan-work (pictoral)]$ git cherry-pick d065ad152f2204295334c5475104a3da517b6ae1

                        # rebuild the module list
[cpan-work (pictoral)]$ dpan

                        # commit the new 02packages.details.txt.gz
[cpan-work (pictoral)]$ git add .
[cpan-work (pictoral)]$ git commit -m "dpan processing"

                        # push back to the mothership
[cpan-work (pictoral)]$ git push origin pictoral

And that’s it. Now point the cpan client to http://yourmachine:3000/pictoral, and you’ll get the limited mirror.

cpan[1]> o conf urllist http://localhost:3000/pictoral
cpan[2]> reload index

cpan[3]> i Acme::EyeDrops
Strange distribution name [Acme::EyeDrops]
Module id = Acme::EyeDrops
    CPAN_USERID  ASAVIGE (Andrew J. Savige &lt;asavige@cpan.org>)
    CPAN_VERSION 1.55
    CPAN_FILE    A/AS/ASAVIGE/Acme-EyeDrops-1.55.tar.gz
    UPLOAD_DATE  2008-12-02
    MANPAGE      Acme::EyeDrops - Visual Programming in Perl
    INST_FILE    /usr/local/share/perl/5.10.0/Acme/EyeDrops.pm
    INST_VERSION 1.55

cpan[4]> i Acme::Bleach
Strange distribution name [Acme::Bleach]
No objects found of any type for argument Acme::Bleach

On the Perils of Importing Remote Tags in Git

So mothers keep your hackers at home
Don’t let them journey all alone
Tell them this world is full of danger
And to shun the repositories of strangers

– The Tag Set of Strangers,
(with apologies to) Nick Cave and the Bad Seeds

One of the things I love about Git is how I can add branches from remote repositories in mine at will without fearing messing up anything. The remote branches will not clash with mine, even if they share the same names, because they are referenced as repository/branch. However, as for anything else, you can still poke yourself in the eye if you try hard enough:

Read the rest of this entry . . .

Start NowWith Pythian - database design, management and emergency handling capabilities...

Live Updates

pythian: RT @FN_Press2: Schooner Information Technology Teams with Pythian to Deliver Advanced Support and High... http://finanznachrichten.de/20
more



Testimonials

  • Serge Racine

    DBA, Brookfield Energy

    We are very satisfied by the service given to us by Andre and Shakir in support of our recent data quality and reorganization initiative.... more



Social links powered by Ecreative Internet Marketing