More Than One?
sub some_sql{
my ($in) = @_;
my $sql = 'SELECT * FROM person where person.id=?'
my $sth -= $dbh->prepare($sql);
my $person = $sth->execute($in);
...
sub some_sql{
my ($in) = @_;
my $sql = 'SELECT * FROM person where person.id=?'
my $sth -= $dbh->prepare($sql);
my $person = $sth->execute($in);
...
Hey everyone,
Following is the p5p (Perl 5 Porters) mailing list summary for the past week. Enjoy!
Geo::Coder::Geocoder::US is a Perl module that interfaces to the Geocoding API of geocoder.us. Unfortunately that disappeared late 2015. Since this module is therefore useless, I am deleting it from CPAN.
This year I attended my fifth YAPC and, as usual, I’ve decided to reflect a bit on the venue, the talks, and the general mood. Since I just did a (roughly) half-post in my date module series, I figured I’d go ahead and do another (roughly) half-post this week instead of waiting for next week.
Well in my last post I added a few new attributes to my Database::Accessor::Element class and when playing about bout today I think I will have to revisit one of them 'aggregate'.
If I just leave it as it is
has 'aggregate' => (
is => 'rw',
isa => 'Str',
);
It will begin to break-down my API as a programmer could come along and enter a very specific Mongo item such as 'mergeObjects' or something odd from an SQL DB like 'DENSERANK' and that makes for a very inconstant API.
So I am just going to bite the bullet and add in a 'Type' for this attribute so lets have a look at that.
I've been tooling around with a fun little app that I'm building on evenings and weekends. As part of that work I figured I'd let users authenticate via Runkeeper. Luckily Runkeeper uses OAuth2 and it's all pretty easy to get going with. I've published my very small contribution as Mojolicious::Plugin::Web::Auth::Site::Runkeeper
On a similar note, earlier this year I also released Mojolicious::Plugin::Web::Auth::Site::Spotify
If you're already using Mojolicious::Plugin::Web::Auth, then these modules will make it trivial for you connect with the Runkeeper and/or Spotify web services.
Read this article on Perl6.Party
DISCLAIMER: data theft is a serious crime in many jurisdictions. The author does not condone or encourage anyone to break laws. The information provided here is for educational purposes only.
Back when I wrote about exploiting operators made of invisible Unicode characters, a bunch of folks pointed out the module containing rogue code would actually have to be imported by the victim and it's not that easy to convince them. Fair enough. Today, we'll play a new game and crank it up a notch!
We all worked on codebases that relied on a dozen of open-sourced modules, each of which relied on a few more, which in turn relied on... well, you get the point. Somewhere, a gazillion levels deep, there's some type of a leftpad in use that you never reviewed for sanity. Right?
So here's our setup:
As YAPC ... TPC::NA draws to a close, there was one final hurrah. About 25 (+/- a few) brave souls partook in the Wednesday Night Pull Request Challenge.
Thank you to craigslist for sponsoring the event. And thank you to both the hard working YAPC organizers and PRC participants for coming together for something that I hope will become continued in the future.
I would be remiss if I did not greatly encourage anyone (no matter your skill level) to get involved in the monthly CPAN PRC Challenge run by Neil Bowers. It is his effort that gave me my first real opportunity to contribute to the Perl community through pull requests; but moreover it inspired me to take a role in introducing the fun to attendees of YAPC::NA::2016.
So continuing on with the attribute fun today in the Moose-pen I am going to have a look at my 'Element' Database::Accessor class. So far like View there is not much to it only 'alias' and 'name'
Now putting my fore-ward looking Moose glasses you can see that I am going to need some more attributes. Well in SQL this class is being used as a field so I will need at least a 'table name' but then again I do not have a table in Classes so I guess I need a 'View' object now I could do this.
has 'view' => (
is => 'rw',
isa => 'View',
);
Do you like simple object system or lerge object system? I like simple object system.
In old days, I believed Perl would need complete object system, which has meta object protocol and class syntax.
Many perl programmers sought a good way to write object oriented programing.
A famouse lerge object system is Moose.
This module has many features, for example,
has, extends, with, is, isa, corce, dose, required, traits, builder, BUILD, DEMOLISH, etc.
A famouse simple object system is Mojo::Base.
This module is a part of Mojolicious.
Mojo::Base only has "has" method and a option to set default attribute value.
Do you know Mojo::Base was a little more complex at first?
Gradually, Mojo::Base removed the features except only really needed ones.
Mojolicious source codes is very clean. Mojolicious only use single inheritance and delegation.
Simple object system and single inheritance produce very clean codes.
I was surprised because I had believed Perl would need complete object system to produce good codes.
Hey everyone,
Following is the p5p (Perl 5 Porters) mailing list summary for the past week. Enjoy!
You can find the most recent version of this tutorial here.
When you suddenly get this brilliant idea, the revolutionary game-changer, all you want to do is to immediately hack some proof of concept to start small project flame from a spark of creativity. So I'll leave you alone for now, with your third mug of coffee and birds chirping first morning songs outside of the window...
...Few years later we meet again. Your proof of concept has grown into a mature, recognizable product. Congratulations! But why the sad face? Your clients are complaining that your product is slow and unresponsive? They want more features? They generate more data? And you cannot do anything about it, despite the fact that you bought the most shiny, expensive database server that is available?
In yesterday's Moose-pen I hinted that I would be getting all my test in order. Well I did that and checked them in but there really was not that much to report on. Just a lot of repetitive code. I suppose I could write one test case to check all of my Database::Accessor classes using some simpler iteration over a list but I really like having a separate test case for all my classes as there really is only a small part that is common between them, so onto something different today.
I am going to start filling in the attributes of my various embedded Database::Accessor classes and I guess the best place to start in with Database::Accessor::View.
Today I saw Damian Conway giving a talk at YAPC::NA 2016 (also known as The Perl Conference now :-). He was talking about some cool Perl 6 features, and I realized that some of them are available right now in Perl 5.
Reaching out to the Perl community at large due to this release being hardware-sensitive and feedback being most useful to me when it comes from many various hardware combinations, particularly if the graphics cards involved are older or stranger.
Please test this CPAN developers release on your platforms to confirm that
there are no regressions from the last stable release. ... Actually,
please do report any and all errors you can see, i am VERY keen to see
what other issues this throws up on different platforms.
This update has seen a LOT of changes since _03/_04, but the main ones are
these:
Thanks to all the feedback i got, i was able to nail things down better and make a new dev release that should at least fix the glut regression:
So today in the Moose-pen I am going to stub in the rest of my Database::Accessor classes and the rest of my Accessor.pm attributes.
It seems I have six outstanting Database::Accessor classes to add in namely;
package
Database::Accessor::Param;
use Moose;
with qw(Database::Accessor::Roles::Base);
has '+name' => ( required => 0 );
1;
Now I quickly realized I should update my Roles a little seems that
[This is a post in my latest long-ass series. You may want to begin at the beginning. I do not promise that the next post in the series will be next week. Just that I will eventually finish it, someday. Unless I get hit by a bus.
IMPORTANT NOTE! When I provide you links to code on GitHub, I’m giving you links to particular commits. This allows me to show you the code as it was at the time the blog post was written and insures that the code references will make sense in the context of this post. Just be aware that the latest version of the code may be very different.]
Last time I cleaned up most of the remaining CPAN Testers failures. This time I’m getting ready for the first official release. There isn’t a lot to talk about here, so this will be (uncharacteristically) a short entry in the series.
Hey everyone,
Following is the p5p (Perl 5 Porters) mailing list summary for the past week. Enjoy!
Perl::Critic::Policy::Variables::ProhibitUnusedVarsStricter (whew!) is a Perl Critic policy that attempts to be more stringent about finding unused variables than the core policy of similar name. One of the things that has to be done to make this happen is to figure out which variables are interpolated into double-quotish strings.
The original version of this module had its own string-analysis logic, as do other Perl-Critic policies that have to figure out which variables are really being used. With the mainstreaming of postfix dereferencing, it seemed to me that the recognition of interpolated variables had become complex enough that a separate module to figure this stuff out was justified. Thus was born PPIx::QuoteLike.
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.