Entering MooseX, Part the Third

Now for my next installment I think I will carry on the same pattern as in my last post namely just taking the next file in line and bending it to my will. So lets see what is next.
Now the namespace is 'MooseX::Meta::Method' and the file is 'Authorized.pm'.

Now my code base I have nothing in this name-space because I wanted to avoid a name-space collision as we all know you cannot have two files with the same name (well except in windows if the case is different). So under 'Method' I added another namespace called 'Role' and add my version of 'Authorized.pm'. there,

So in the the original we have

mop problem 1 - mop can't have protected attribute variable

mop can't have protected attribute variable. All attribute variable is private in the class.

Let's delete 10,000 files from CPAN

This week, let's delete 10,000 (decimal) files from CPAN. Thanks to Ricardo, we're almost a tenth of the way there.

rik_spring_cleaning.png

We're a month into spring and some of the world just celebrated Earth Day, so it's time for the thousands of PAUSE authors to each delete one old distribution (which is three files in your CPAN author directory). Visit your delete files PAUSE page to "increase the Schwartz". You can even clean up your directory with WWW:::PAUSE::CleanUpHomeDir or with App::PAUSE::cleanup.

It's not quite enough for you as the PAUSE author to delete your files. We want to get the word out, so I'd like you to get one other PAUSE author to do the same. Use your social media networks, peer pressure, begging, or whatever your favorite method is, not because there's any danger of running out of space, but because it's fun to delete things and see them disappear.

MetaCPAN Officially Welcomes Our OPfW and GSoC Participants

The MetaCPAN project would like officially to welcome our summer of 2014 Google Summer of Code (GSoC) and Outreach Program for Women (OPfW) participants. We had a lot of interest this time around and some great applications. Our OPfW participant is Pattawan Kaewduangdee and our GSoC student is Talina Shrotriya. Both Talina and Pattawan have plans to make some much needed improvements to MetaCPAN and we're really looking forward to working with them. I've linked to both of their Github profiles above in case you want to track their progress commit by commit.

I'd also like to thank the Perl Foundation for its support in both of these programs. Lately I've had a chance to glimpse how much work goes on behind the scenes to make these sorts of programs happen and I can tell you it's impressive to see how much volunteer work is involved in something like this.

Entering MooseX, Part the Second

Well in my last post I managed to de-break my Perl by creating that was for all intensive purposes justa rename and a little rejigged clone of MooseX::Authorized Methods

So onto making this into something that I want.

Well might as well start at the beginning 'MooseX::AuthorizedMethodRoles'

So It starts with

Perl and Windows UAC

While doing some Registry-related things with Perl a couple of weeks ago, I ran into something that took me nearly a day to figure out: Win32::TieRegistry asks for write access to the Registry by default, and under Win7 that requires Administrator privileges. (I kid you not, it took me over a day to figure that out.)

Well, getting what turns out to be called "elevated privileges" from Perl turns out to have been pretty hard - a lot harder than it should have been, for reasons I went into in some detail in a little article about it, but, to cut straight to the chase, I came up with a way to get Perl to restart a script after invoking UAC to gain elevated privileges. It's got some weaknesses that are inherent to the way Windows manages the console, but, well, I present to you Win32::RunAsAdmin. You can use it like this:

Testing Lies Video

I was recently at the 2014 German Perl Workshop and I've written about it at our company blog.

Introducing Term::TablePrint

Term::TablePrint (its function print_table) prints a table or the selected columns of the table to STDOUT.

print_table provides a cursor which highlights the row on which it is located. The user can scroll through the table with the different cursor keys.

If the table has more rows than the terminal the table is divided up on as many pages as needed automatically. Also if the terminal is too narrow to print the table the columns are adjusted to the available width automatically.

Leaving Moose Entering MooseX

Well things are progressing for me. You might remember a resent post of mine where I badly injured my Perl and another post where I started down the road of healing. Well today I finally wrote my first MooseX a variation on MooseX::Authorized Methods which rather that using some sort of 'User' who has some sort of 'role' method I just set it up so the class instance must have at least one 'Role' to use the method.

Now I make no apologies here all I really did was copy out Daniel's make a few changes in the name spaces and have my own default verifier.

So now instead of

MooseX::AuthorizedMethods
MooseX::Meta::Method::Authorized
MooseX::Meta::Method::Authorized::CheckRoles
MooseX::Meta::Method::Authorized::Application::ToClass
MooseX::Meta::Method::Authorized::Application::ToComposite
MooseX::Meta::Method::Authorized::Application::ToInstance
MooseX::Meta::Method::Authorized::Meta::Role

I have

German Perl Workshop 2014 - Talks available on YouTube - T+25 days

A good three weeks have passed since the 16th German Perl Workshop in Hanover took place, and we are happy to anounce that we are now done processing the videos of the talks. You can find the playlist on YouTube. Don't forget to switch to HD as it took us a long time to upload everything in 1080p.

We would like to thank all the speakers for giving their permission to make these videos public and hope you will enjoy them.

DE: http://www.perl-community.de/bat/poard/message/174894

More than a life sign

Cheers Perl community - I'm not dead :), no currently I partially study music and delve into instruments, - more precisely I'm building synthesizers with NI Reaktor.

parsing email to get required information using perl script

Hi,


I am new to perl and i need some help in parsing email's using some perl script and get required information

Below is the sample email format in the logfile

From Mon Apr 14 20:24:14 2014
Return-Path:
-----------------
--
----
-----
--------
Date: Mon, 14 Apr 2014 13:23:06 -0700
Message-Id: <201404142023.s3EKN6LQ016845@xxx.com>
From:
To:
Subject: WARNING :
X-Priority: 1
Content-type: text/html
X-Milter-Version: master.31+4-gbc07cd5+
X-CLX-ID: 507038003
Reply-To: -----
X-Loop: ----
X-Sequence: 197227
Errors-to: -----
Precedence: bulk
X-no-archive: yes
List-Id: <---->

< Body of the email >


in log file we have lot of emails and we need to skip email's which has reply

I need below information

Date:
Message-Id:
From:
Subject:

Email start with From at the start of the line


can any one help me with the sample code

Acme Comes Through Again

Well was programming away today (after doing 8 hours of unpaid household chores) and I had to do the old place a file in a dir but make sure you do not overwrite the last one trick.

There are of course all sorts of ways to do this but the most common is to use the current time in some way and add it into the file name. The good old Perl 'time' function is the quick and dirty way as it gets a slew of numbers any you can just tack it on the end like this

 
my $time = time;
my $file ="somefile.".$time;

Of course that will work but does give you rather ugly file extension and it is always a
nasty pain to convert it over to something that is nice to look at and easily readable.

Views in DBIx::Class

Did you know you can write a view in DBIx::Class? The DBIx::Class::ResultSource::View module makes this very easy and it's helped me solve a very thorny problem in Veure: how do I efficiently make sure that email sent from Alpha Centauri to Epsilon Eridani doesn't show up instantly in your inbox?

Improving the grant program (2) Bi-monthly Grant Cycle

Continued from the previous post.

From the comments to Alberto's post:

The 3-monthly call for grants, and the 1 month taken to assess grants, means that there is a 1-4 month lead time between "now" and when a proposal can be accepted.

Now we have a bi-monthly cycle, +50% added frequency, the lead time between "now" and when a proposal can be accepted can be as short as 3 weeks. Or 3 weeks + 2 months at the longest (announcement).

Should we make it monthly? Certainly yes if we have more applications. If we get a lot more proposals every two month, it will be appropriate to make it more frequent.

Bi-weekly cycle? Well, the Committee Secretary needs a break :)


Frequently anticipated questions

So the lead time is between (x weeks) and (x weeks + y months). Any views to make x smaller?

Right. It is easy to decrease y by increasing the voting frequency. However x is a different story.

OT: PLOS ONE Has an RSS Feed

If you like to follow academic progress in CS, PLOS ONE has an RSS feed. (I don't know my feed types upon inspection -- it might be Atom rather than RSS. Still nice to have the feed, though.)

On the Correct Path Again

Well back to Perl posting today. You might remember a very bad thing I did in my last post namely altering an installed module and thus breaking any chance of portability or at least maintainability of my current project.

Well the old story of short term expedience for long term failure is fine for the next few days but I really do need a better solution so in the end I will have to write some of my own code.

Well I was thinking of just writing a different version of 'MooseX-AuthorizedMethods' unfortunately this was not as easy as I first thought. Seems the above Mod the way it was designed sort of hogs the 'Method::Authorized' namespace as I do not see anyway I could add my own 'Method::Authorized' package without either clobbering the original or rewriting it to be more namespace friendly.

So what to do??

Maintainer's Notes on rt.cpan.org

If you are a CPAN author, this is for you. Otherwise it's still time to become one!

RT.cpan.org has a little known feature called Maintainer's Notes. Maintainers of a CPAN distribution can put a piece of HTML above the tickets list.

Introducing fsql and chart

These are two command-line utilities to help you slice/dice and visualize data on the console. fsql utilizes DBD::CSV and a few other modules to let you perform SQL queries against CSV/TSV/LTSV/JSON/YAML files. chart generates simple ASCII charts. I'll give an example for using these tools.

Viewing monthly CPAN releases activity

I maintain a file called releases.txt in the LTSV format. Whenever I do a release, this file gets updated with a new entry.

Finding out how many releases I've done, or even how many releases for a specific year/month/day, is easy. The good ol' Unix commands like grep and wc suffice:

% wc -l < releases.txt
2746

% grep date:2014-03 releases.txt | wc -l
91

Strawberry Perl 5.18.2.2 released

Strawberry Perl 5.18.2.2 is available at http://strawberryperl.com
(all editions: MSI, ZIP, PortableZIP for both: 32/64bit MS Windows)

More details in Release Notes:
http://strawberryperl.com/release-notes/5.18.2.2-32bit.html
http://strawberryperl.com/release-notes/5.18.2.2-64bit.html

I would like to thank our sponsor AuditSquare.com for resources provided to our project.

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.