This is a shot of the rooftop terrace on the Pyle Center roof...

This is a shot of the rooftop terrace on the Pyle Center roof where the YAPC::NA 2012 banquet will be held on Wednesday, June 13th.
This is a shot of the rooftop terrace on the Pyle Center roof where the YAPC::NA 2012 banquet will be held on Wednesday, June 13th.
In this post, I talk about how
Perl 5 parses its
use
statement.
The use
statement
is implemented with
what I have named
"Ruby Slippers" parsing.
The idea is that you parse with a convenient grammar,
but one which is too simple to actually describe the language
you are parsing.
For example, if you are parsing HTML, the grammar might assume
all start tags have end tags.
Whenever the simplified grammar has trouble parsing, the lexer fixes the situation by pretending the input is what the parser wants to see. The parser is like Dorothy in the Wizard of Oz, who really would like to be back in Kansas. The lexer is like the good witch, Glenda, who assures Dorothy that, because of her Ruby Slippers, Dorothy really can be wherever she wants to be.
"Perl is, by and large, a digested and simplified version of Unix. Perl is the Cliff Notes of Unix" - Larry Wall
I could never really get myself to learn sed, awk, zsh, grep, find, m4, pipes, xargs, tee, cut, paste, yacc, lex, various IPC or even C for that matter. I ought to.
In practice, in almost most all cases I use perl.
Perl equivalents to the above are psed, jawk, ack, IPC::Run, IPC:: ..., IO::All, ppt, A real parser, reference counted pointers(if you ever miss c), POSIX and even a shell. You can also, easily write yourself one script that exactly does what you want to.
The other thing that makes me keep coming back to perl are the books. I have read every book of every programming language out there, but I always end up re-reading perl books ... because the other books put me to sleep.
I have found a couple of attempts at integrating perltidy into Git commit hooks, but nothing yet that I considered robust enough. The scripts ignore the state of the index, modify the working tree, and then forget to update the index before the commit. They didn't recover from a failed tidy run, leaving both the working tree and index messed up. Critically for me I could not do an interactive or patched "git add" and have the final commit reflect what I wanted.
githook-perltidy is my answer to this challenge. Robustness is achieved by stashing the working tree and index before the tidy run, which is re-applied on error. The same stash can be applied on top of the new commit (using a post-commit hook) to merge non-indexed working tree changes afterwards. The POD inside the script hopefully documents the process in sufficient detail to give you confidence in the method. Code has the final say of course...
You can grab a tar or zip file of the distribution now from the github repository at https://github.com/mlawren/githook-perltidy. Feedback (and patches for tests!) is welcome.
I’m very pleased to announce that Best Practical Solutions is sponsoring YAPC::NA 2012. Best Practical Solutions are the creators of RT: Request Tracker, the leading open-source issue tracking system.
Best Practical was founded to deliver value to RT’s established base of users by providing custom development and user support for RT. We are fully committed to supporting RT as an open source technology, while providing the quality development and support necessary to operations in commercial enterprises and corporations.
$foo - Perl Magazine is our second sponsor.
The purpose of $foo magazine is to present and discuss projects written in Perl; to keep up-to-date with the latest news in the community including about The Perl Foundation; to publish tutorials on Perl projects such as WxPerl, Perl 6, Moose; it also gives news on CPAN modules (6 new modules are covered in each issue).
We will contact more companies when we created a paper for potential sponsors that will explain the sponsorship levels. I hope this will be done in October...
Whenever you don't have a perl installation or a commandline available, or you want to show somebody else information about core modules, you can use:
The website has been around for some years, but wasn't very well known and actually a bit ugly. I've redesigned it, added a new diff function and moved it to a new server where it can run under mod_perl.
The diff function allows you to compare two perl versions for added, removed or changed modules.
I'm also thinking about auto completion but maybe this is overkill for such a small tool.
edit: I have added links to ppm and debian searches. if you have any other resource for module search (redhat, ...), please post.
You can debug JavaScript executing inside a WebBrowser control embedded in your .NET 4.0 application from VS2010 (Visual Studio 2010), but it takes a little effort.
(Posted here so I don't forget the steps.)
(This was abstracted from many sources including Silverlight 4 Tools for Visual Studio 2010 Debugging Overview.)
An interesting question came up today regarding our team’s Act development for YAPC::NA: Are we going to take the effort to maintain internationalization for the new features we add? My answer was an emphatic yes!
We’re a US conference, with a team largely composed of US programmers (we have a few foreigners lending us a hand; thanks, guys!). Even so, Perl is not exclusively a US programming language; people all over the world use Perl for just about everything! The Act team has been doing a great job making their application available to people speaking a variety of languages, and I’m proud to carry on that tradition. Now, if you’ve never written internationalized code before, the prospect may seem a bit daunting; so here’s a tip you can use when working on Act:
Hi everyone!
I have written an article about defunct processes under UNIX. I think it will help someone what is going on inside UNIX IPC :) Everyone is welcomed: IT Remarks
The deadline for submissions of the YAPC::Europe 2011 Conference Survey and Talk Evaluations is tomorrow. If you attended YAPC::Europe in Riga, and haven't already done so, please take some time to complete the survey and give your feedback both to the current organisers and future organisers. Whether you only attended for the first time this year, or have been attending for years, all feedback is useful and worthwhile.
So far we've had 144 surveys and 713 evaluations submitted, and a big thank you to all those complete the forms.
I plan to work on the talk evaluations over the weekend and send them out to speakers early next week. I shall then work on the survey results, which will be posted on the YAPC Conference Surveys site.
We’re pleased to announce that Shutterstock has become Gold Sponsor of YAPC::NA 2012. Shutterstock loves Perl. They’re a stock photo and video company, and are at the forefront of technology and research. They do fascinating things with search, discovery, recommendation engines, and scalability. They’re looking for really smart people and great engineers to help them to continue to be a leader in the industry. They focus on fast, iterative development (over 150 deployments/month) and collaborative, interactive programming. Developers work on small cross-functional teams (4-6 people) that have a voice in setting their own priorities and are expected to build and deploy applications quickly and iteratively.
If that’s not enough, check out these other perks:
I wrote this on beginners@perl.org today in a thread which was discussing short variable names:
One of the advantages to Perl is that as a scripting language, a small script can be coded to perform a simple task. For example, I enjoy sharing photos of family over the internet, but all the images are at least 2.4Mb in disk size! Using a mix of Perl and Unix commands, I have a script no bigger than 1 page to resize entire folders for me.
I like to use an iterative method of programming. Code some lines, execute and test. Rinse and repeat. But I found my method of debugging annoying. $\ = "\n"; and print() statements to sanity check my variables, only to delete or comment those lines later.
Enter a great Module: Devel::Comments A module to help with debugging in the development stage by using the comment lines in your scripts.
Make the comments in your code work for you. Now to view the value of a variable: write:
### $mainDirectory
and STDERR will print out:
### $mainDirectory: /home/tyler/perl
Initial checks on the database highlighted some discrepancies, which have now been fixed. The databases have now been archived and are now rebuilding. It is hoped that this will be completed within the next few days.
Once the database are all rebuilt and sync'ed, the websites will slowly be switched back on. The first sites that will appear will be the Statistics and Devel sites, with the Reports website coming back online once the bulk of the support files (JSON, JS & HTML) have been recreated.
Now would be a great time to remind your family that what you really want for Christmas is an all expenses paid trip to YAPC::NA 2012!
The dates are June 13-15 in Madison, Wisconsin. And while they’re at it, they should also send your spouse with you to enjoy the Spouses Program.
... or happy debugging!
TL;DR Upd: Use for instead of given, as Aristotle suggests.
Here are some code snippets to show what's wrong with given/when.
use 5.010;
use strict;
use List::MoreUtils qw/any/;
given ('test') {
when ('test') {
say "any" if any {$_ == 2} (2, 3);
}
}
The above code prints nothing. Ok, let's change any to grep to see if it works:
Twin City Perl Workshop 2011 in Vienna and Bratislava is now open for registration. The event will take place on Friday, 4th November, in Vienna (@ Metalab), and on Saturday, 5th November, in Bratislava (@ Hotel Barónka).
If you want to present anything Perl-related in English, Slovak and/or German, please submit a talk!
Train transfer between Vienna and Bratislava is sponsored by Booking.com - thanks a lot! If you or your company / organization would like to sponsor, too, do not hesitate to contact us!
See you in Vienna & Bratislava!
(Crossposted from domm.plix.at)
Two of these can permanently drop the UID to 1000. The other two however results in a state where a previous privileged state can be restored. Can you spot which ones are right and which ones not? And most importantly: why?
$< = 1000;
$> = 1000;
$> = 1000;
$< = 1000;
$< = $> = 1000
$> = $< = 1000
blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.