June 2014 Archives

XS, Advanced XS Callback Patch For OCI, Part III The Plan

Adding some more for the new chapter in XS Fun. Today I am just going to go my implimetaion plan of what needs to be changed how that fits into the world of XS

The Plan

The first thing to note about this patch is that there is no change to the Oracle.xs file. Now the reason for this is has been hinted at earlier in the chapter and that is DBD::Oracle is largely a 'C' program that is linked directly with Perl using dynaloader and its bootstrap method.

So we…

XS, Advanced XS Callback Patch For OCI, Part II

Well continuing along with my new chapter for XS Fun. Today I am just going to introduce the Oracle part of the equation and what one has do with OCI and Perl before
Oracle HA (High Availability) Events

A small part of Oracle's HA packages are notification that are sent out when an HA event takes place, This could be a server going down, one coming up one swapping out and a number of others.

Now to actually generate these events one need …

XS, Advanced XS Callback Patch For OCI

So I am keeping these XS posts in two places here and as a chapter here Hopefully once I am done it will be accepted my the current maintainers of that Github

Chapter 03 - Advanced XS Callback Patch For OCI


Now we are going to jump off the deep end of XS programming and do a patch to DBD::Oracle.
Now DBD::Oracle is the poster child of early XSW programming. Starting out
way back in the stone ages starting …

XS, I Spoke too soon

Well in my last post like almost all other XS post I started out by lamenting the sad truth that there was little in the way or resources for XS in 2010 and things haven't improved much since then.

Well I was wrong. While doing a little research for this post I stumbled onto XS-Fun up on github and was so surprised at what I found I decided to do a quick review on it for today's post.

Well it is new tutorial, less than an year old and a work in progr…

XS, Enough Said

Well I think I will tackle a difficult subject for my next series and that is XS programming or how to add C to you Perl and learn to regret it.

XS programming is not for the faint of heart I will warn you know it is tedious, stressful, unrewarding, undocumented and hard to learn. However if you can get past the first few high hurdles it is well worth the effort.

Now XS programming is not rare you can find it all over CPAN and I can almost grantee if you have ever used Perl to log into a DB then you have used XS.

So it is there and in use every day, it just works an…

Enter MooseX, Appendix II Last One I Promiss!

Well This should really be the last one in this series baring any big problems that come down the line if people ever end up using this MooseX.

So in my last post I applied the first patch to my MooseX by simply clicking a button on github and I must say I am pleased with the result

So not I get a full green board on CPAN testers for V0.00.05 with 33 passes and 33 attempts however I do see…

Enter MooseX, Appendix I Not Again!!

Honestly I though my last post would be the final one of this rather lenghty series but I was wrong.

Seems soon after my release I got what I think is my first ever 'Pull Request' from github from the resident mooz giiyosewinini na Toby Inkster so I had to post on that today.

Well Seems there is a better fix for the bugs/errors that where thrown in the first version of MooseX::AuthorizedMethodRoles as the root of the problem was the inability of perls less that …

Enter MooseX, V Well Thats a Wrap

Well a wrap for Kwalitee at least as my little changes from my last post left me with only one Extra metric

is prereq

Well there is not much I can do about that unless one of the many legions of my readers, (well maybe a contubernium at least) will have to do that for me.

So I did improve from 86%/111.2 in version 00.001 to 100%/134.4 for version 0.00.04 so not bad bu…

Enter MooseX, IV 100% Nice and Clean

Well I did it my Kwalitee results are now at 100% but I see from a comment on my last post that there is a way to fix an Emperimental metics

metayml has provides

and that is to use 'MetaProvides::Package' so a quick update to my ini file and of course it did not work as I did not have the pl…

Enter MooseX, III Now Lets see whats up.

So I have the latest Kwalitee results from my latest changes and I have improved a little now at 96.88 up from my 84.83 and only one Core fail

package version matches dist version

Still haven't got that right but at leas my README.pod is acceptable to CPANTS.

So a quick look and yikes I guess I fixed the Dist::Zilla ini file

name = MooseX-AuthorizedMethodRoles
version = 0.00.02
author = John Scoles
license = GPL_1

Enter MooseX, II Now Lets Clean Things Up.

Well after my excitement of the release this week after fixing a few obvious pod bugs and cleaning up the repository, I was going to take a look at the Kwalitee page and clean what it tells me.

So the first thing to look at is the Core Metrics and the first on my hit list is

has readme

So I guess my Dist::Zilla did not pick up that file as I do remeber creating a bad one but I will create a better on just in case. Now what I have seen in the past is to just use to …

Enter MooseX, The First, I made it

Well I am happy to say my first MooseX module MooseX::AuthorizedMethodRoles is now happily up on CPAN and awaiting global usage by the entire Nation of Perl.

Well maybe not, I have found a use for it and maybe some one else will someday we will see what comes of it,

Now that I am a proud MooseX authour I wonder if I get to wear a funny hat of special badge or maybe at the next YAPC EU conference at the big dinner I will be asked to sit at the cool kids table


Entering MooseX, XXVIII Its on its way!

Well I am finally there after what almost a month of plucking away at it I am going to do the release.

Well I did go with Dist::Zilla and after a quick 'dzil smoke' I did a 'dzil build' and I am ready to send it off.

Well after the usual looking for my Pause password and having it reset yet again (I must hold a record for that) I was finally able to send my MooseX up to PAUSE

Add a file for BYTEROCK
File successfully copied to '/home/ftp/incoming/MooseX-AuthorizedMethodRoles-0.001.tar.gz'

So now I just have to hang aroun…

Entering MooseX, XXVII It is all in the Git

Well actually my blog tonight is not on MooseX, Moose or even Perl but it is part of this little project of mine and I figure it is good for a single post.

Well today I started to play with the latest and greatest version of the Github for Windows so those of you who don't care about such things you can go back to you linux command line and not bother to read any further.

Well I have used GitHub (painfully) for a few years now, started with a few command line stuff but never worked quite right for me but things improved when I installe…

Entering MooseX, XXVI It will be on CPAN by Christmass!

Where have we heard that before?? Well today I did mange to get my POD mostly written up and now I just have to look into one or two other important matters and I think I can give it a go.

First it is a question of Version.

Well there are many version patterns to pick from. Most of the time it does not matter sometimes it does as the time I stuck an 'a' in a DBD::Oracle version and took the wrath of a good number of other Module builders and I am still most likely paying the price for d…

Well why not All

So no MooseX or AD&D post tonight as I go sidetracked on anotehr project but at least I did manage to get one post out of it and finally found out how to do something in Perl I have been wanting to do for years.

You see I came back to Perl after a number of years playing with Java and JSPs, I was happy with JSP and Java there where some annoying things (hard to manipulate text) and some very good things, strong OO. In my move back to Perl some 10 years after last playing with in (early 90s) I regret leaving Java that much but there was always always one thing I missed from that world…

Entering MooseX, XXV 25 Post and Still Nothing on CPAN??

Well this is true this is the 25th post in this series and I still haven't released the code I started with in this post. Please to be forgiving me as it has been rather heck-tick about here but I think I should be able to wrap things up soon.

I really just have the POD to write up which I am going to look at tonight. One thing that you do here about Perl when talking to non-Perl programmer is that is lacks documentation like JAVA. Usually when I here this I send them off to Ensemble /users/byterock/2014/06/index.html

Entering MooseX, XXIV Well Now Lets See

Well there can be only one winner in the great Dist creator review but first here are the modules I had a look at

  1. Dist::Zilla the main one that gets all the buzz these days
  2. Dist-Maker One I just spotted and keen to learn about.
  3. Dist::Inkt Toby wrote it so it must be good! Right?
  4. Distribution::Cooker Funny this one is by Brian D …

Entering MooseX, XXIII A little More

Well done to my last candidate Dist-Man so I am hoping to get lucky with this one as the past three though useful when creating a dist from scratch did not help me much when I wanted to just create the boiler plate for a dist from already existing code base.

So it dose install easily with very few dependencies and the documentation is quite good but unfortunately like all of the tools I looked at so far, except Dist::Zillia, I really should be using this pro gramme to create new mods rather than creating the Boiler plate for my new …

Entering MooseX, XXII Just two more

Well on to the next little module I am going to have a look at Distribution-Cooker another creation from the prolific keyboard of Brian DeFoy. Well I am batting 0-3 for another module to do what I want, fill in all the boiler plate and package up all my stuff from my MooseX modules.

While this is a nice little module like the last two it is really a starting point for module creation rather that a tool to help out packaging it.

Like the last one you simply create…

Entering MooseX: XXI Not the Best Superbowl Ever

Well today I am going to give the quick one-two to Toby's little creation called 'Dist::Inkt' or as the subtitle calles it Yet Another distribution builder why he didn't call it YADB I will never know but that was for hit to decided.

So a usual these days I had a quick look at the compatibility matrix on CPAN Testers and it seems to be windows friendly and the dependency list is not too bad and it seem to install ok after the usual huff and puffing on by drive.

Now the docum…

Entering MooseX: XX Even more Xes

Well looking at my next victim on the list and so I was going to have a look at Dist::Maker. Well sorry to say this one seems out of the running very early on. As from what I have discovered on its documentation it is really is just for creating distributions from scratch. Pity as I already have most of my dist done so I will just play that I haven't done that part yet and see what I come up with

Well it did install smoothly even though I used a new clean version of Perl it only took a few mins compared to the over 45 for Dist:…

Entering MooseX, XIX Now We Package II

So in my last post I had started to play about with Dist::Zilla and my initial playing about I was very pleased at what it gave me. Now I did have a few thinks to clean up, some test roles that where throwing some sort of warning when they should not and where I was building the Mod was 100% right.

So the first the extra roles

Warning: prerequisite test_role1 0 not found.
Warning: prerequisite test_role2 0 not found.
Warning: prerequisite test_role3 0 not found.

Entering MooseX, XVIII Now We Package

Well starting today to look at Dist::Zilla and as I develop mostly on a Winders box (yes I know I a not a real Perl programmer) I had a look at the Testing Matrix to make sure I can use it and I can. So step two was a doing the install and it does have quite the dependency list and my Perl is quite sparse in terms of installations so it took a good half-hour to install all the needed modules and this is my new super fast 64k super gaming lap top so I would think it is a…

Entering MooseX, Part the Seventeenth

Hey guess what no tests today and really not much of a blog either.

I and now moving into actually creating a distribution for this little mod of mine now that I have all the code written and all the tests done, though I really should do the POD next I am going to step out of order a little and look at different ways to create a distrabution

Well the reason why I am doing this is that I have only ever done it the craftsman way. Or in other words by hand and hope for the best.

So I have been shopping about looking for something that will help me out. Well went to META:…

Entering MooseX, Part the Sixteenth

Well I really mean it this is I think the last last .t for this module. This time I will be testing the use of my new module as a trait. So here goes

I start with the usual suspects

#!perl -T
use strict;
use warnings;

use Test::More tests => 5;

package test_role1;
use Moose::Role;
has 'nothing_r1 '=> (is => 'ro',default=>'role 1');

package test_role2;
use Moose::Role;
has 'nothing_r2' => (is…

And Now for Something Not Moose Releated

Well been eating way too much over the past posts so I though i would go though today's little upset for a change in pace.

Well today I was going back in time a little and had to write up a little script that would get the latest file on a dir and count the number of lines in it (don't ask why) and the do a little more processing.

Well it seemed simple enough and I have done similar before but for kicks I decided to do a Google search for 'Get the latest file with Perl'

Well my eye got sore after reading the endless variations on the same theme, from 30 line monstros…

Entering MooseX, The Check is in the Mail

Well if you believed the title of this post then you will believe this one as well. So I left off yesterday with a failing .t

my $test2 = test_one_of_fail->new();
eval {


In the case I was able to run the 'ping' sub so it fail because I got nothing in the '$@'

Well after some time playing abou…

Entering MooseX, The Last Test I Promise*

Well nearing the end of my test now, I have done the basic stuff in this post,the api parts here, the validation bits in this one and the instance bits with my last one. So to carry on I think it would be…

Entering MooseX, Thirteen Lucky for Some

Well going on with my revised tests from my last post I am now going to look at the instance usage of my little MooseX.

Well normally I have been using this MooseX with Classes that use Moose::Util to install new roles so that is what I going to test in this next .t, so lets start with

#!perl -T
use Test::More tests => 3;
use Test::Moose::More;

use Moose…

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations