Merry Christmas
I’d like to wish all of our sponsors a very Merry Christmas. Without you YAPC::NA 2012 wouldn’t be possible. And because of you, YAPC::NA 2012 is shaping up to be an absolutely amazing event.
I’d like to wish all of our sponsors a very Merry Christmas. Without you YAPC::NA 2012 wouldn’t be possible. And because of you, YAPC::NA 2012 is shaping up to be an absolutely amazing event.
In trying to learn 5.10 grammar-like regex features and wrote a program that, while matching simple Lisp-like constructs, builds up a data structure. This involves recursing into subpatterns, but I couldn't find a way to assemble the resulting tree from the bottom up. Therefore I used a stack.
Do you know of a better way of building the data structure with the given regex/grammar?
(I'm aware of Parse::RecDescent and Regexp::Grammars, but wanted to do this as simply as possible.)
tl;dr version: The design of require
makes it all but impossible to use in a secure and correct fashion. To fix this, Perl needs two new ops: one which will only load files, and one which will only load modules. Both would only load from @INC
.
The more I look into the problem, the more I'm convinced that there is no good way to load a module from a variable in Perl. None of the existing techniques or modules fully solve the problem. They all have security holes or limitations. This is kind of embarrassing, it's an easy thing and it should be easy. My investigation into how many ways the simple act of loading a module can go wrong has lead me to believe that the solution is a new op which just loads modules.
For those of you wondering, near as I can tell this is how you correctly and securely load a module from a variable...
To build a package, use Module::Install, ya turkey!
Update: Per mstpan, one should not use Module::Install!
cpan Module::Install
Make a directory for your package to reside:
mkdir /home/you/My-Package
Put your module in the 'lib' directory. This is where all your code is going to live.
mkdir lib
mkdir My
touch My/Package.pm
Put your code in My/Package.pm, or copy the file you already wrote here.
Then, create a Makefile.PL in /home/you/My-Package:
This is a shot of the Epsilon Sigma Phi Conference Room, which will be available June 11th & 12th before (the 2 days before YAPC::NA 2012) for the Hackathon.
Method::Signatures::Simple: Nice, very simple, and almost as fast as pure perl, is this module ready for use in modules you depend on?
Inspired by a recent blog post on patching cpanminus, I decided to spend a few minutes patching cpanm for a small itch I have: sometimes I want to download distribution tarballs only without building/installing. This patch adds a --download command to do just that.
To try it out for yourself:
$ git clone git://github.com/sharyanto/cpanminus.git $ cd cpanminus $ script/build.PL $ perl Makefile.PL && make install $ cpanm --download CGI Data::FormValidator
As some of you may have heard, Perl had been registered as a trademark by somebody other than TPF or any Perl related entity. Last year as soon as we realized that this had been done, we contacted some lawyers and TPF, and immediately filed a complaint.
We had been told that this whole process would take about a year, and finally I'm happy to announce that this decision has been reversed, and the above mentioned trademark has been revoked (I'm not a lawyer type, so excuse me if my words of choice there are not technically correct).
This was a joint effort by Japan Perl Association and Yet Another Society/The Perl Foundation, with a little bit of help by a hacker who shall remain anonymous, just in case. I'm happy that we were able to work this through.
That leaves the actual petition by TPF/YAS for the true trademark for Perl in Japan, but that's a whole different story. For now, I'm happy we're free to use Perl without worry.
We have a special treat for you today, a title unification match. In the corner to my right, haling from mysql.com, the undisputed world leader in users - MySQL! In the corner to my left, hailing from postgresql.org, the undisputed world leader in geek credibility - Postgres!
At YAPC::NA 2012 we will once and for all declare a winner in the RDBMS wars. Winner take all. Loser stripped of it’s title and goes home with it’s tail between it’s legs!
The other day I was wondering about $?
in Perl and the shell and how exit statuses work.
I did some digging and now I'd like to talk a bit about exit statuses at the OS level and how Perl and the shell deal with it.
First off, there are two ways a unix process can terminate.
One is by calling _exit
, the other is getting killed by a signal.
In both cases the resources of the process (such as memory or file descriptors) are cleaned up.
All that remains is an entry in the process table (i.e. the PID is still taken) and some status information on how the process died.
This "stale" process table entry is called a zombie process.
After a process has terminated, it's its parent's job to clean up after it by calling wait
or simply exiting itself (a process whose parent has died is known as an orphan process; it will be adopted and cleaned up by init
, the process with id 1).
I've been messing around with Objective-C off and on for a while now. Whenever I take a break and come back to it, I find myself having to look up some of the same syntax over and over. Some examples would be:
Perl:$foo =~ s{bar}{baz}g;Objective-C:
foo = [foo stringByReplacingOccurrencesOfString:@"bar" withString:@"baz"];Perl:
$list{'foo'} = 'baz';Objective-C:
[list setObject:baz forKey:@"foo"];
For the past several years, I'd been set on YAML as the format for configuration file. It's human-readable, pretty, portable, and support arbitrary data structures. But for future projects, I'm planning to use INI format. Why?
First of all, YAML is "too complex" for users. There are subtle syntaxes, like the requirement for list separator character (,) or the mapping character (:) to be followed by space. And then there are object literals like Yes/No/true/false, ~, date/time, etc. And the various ways to do heredocs. It would take at the very least an hour to explain the syntax to first timers, and days to familiarize with it.
Second, and this is more important for me, there are no round-trip parsers/emitters for YAML. You can't modify data without reformatting the whole file and removing all comments.
Infinity Interactive is a New York based, multi-discipline consultancy that serves global organizations with local attention. We build simple websites, infrastructure for multi-national corporations and everything in between. Our strengths are our relationships with our partner companies and our focus on quality.
We are committed to open source software and are very active in the Perl community. Therefore we are proud to sponsor YAPC::NA 2012!
I always wanted to write about Perl but never got the time to do. Recently came across to some of Neil Bowers published blogs which gave me the necessary push to write something useful. I feel honored to have worked with Neil Bowers in the past.
For the last 6 years or so I never got the opportunity to do any kind of web development. Although I kept in touch with all the web related stuff that is happening in the Perl e.g. Catalyst, Dancer, Moose. Also during my web development period, I never used any kind of MVC, ORM but these days everyone wants all these. So cut the long story short, I created the web app using the traditional perl-cgi-dbi logic, which as expected they didn't seem to approve it.
I've added a new article to my software-development / testing blog, called: Agile Scrum: Delivering Broken Software Since 1991 - looks at how Scrum can get subverted, and how to fix it. Enjoy!
One thing that many people like to do when they travel is find restaurants and bars with rooftop seating. These kinds of places often have great views of the city, plus the crisp and refreshing air of the night sky. It’s hard to resist, especially since it’s only 3 blocks from YAPC.
Johnny O’s Sports Lounge is one such place in Madison, and they also have the distinction of being the closest restaurant/pub to YAPC to offer rooftop seating. An interesting feature of Johnny O’s is that they also offer basketball on the rooftop, as well as the a band on some nights.
Here's my definitive guide to creating a Perl package (non-OO) for retards.
first we can use find's exec opiton
find . -name CVS -exec ls -dl {} \;
also we can use shell
for i in `find . -name CVS` ; do echo -n $i," "; done
change ls, echo to whatever suits you, like rm -rf
We only have two more weeks until YAPC::Asia Tokyo 2011!
I have secured what's called an "event insurance" which will cover any injuries or damages to the facility during the conference, so we're pretty much all set now. Just counting the days now...
And while we're at it, I'm happy to announce that YAPC::Asia Tokyo 2011 tickets are now completely sold out.
Normally we close the ticket sales while we still have a small amount of tickets left, but this year the tickets went very fast, well, we're now sold out, including about 70 student tickets -- this is particularly good, because we believe we need more young blood.
And due to the overwhelming number of inquiries, we're going to be selling a few tickets at the door (unfortunately this ticket will not have many of the benefits that come with the regular ticket :/ ). First come first serve, so if you haven't bought your tickets yet, come early on 10/14 to secure your ticket.
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.