Why your talk won't be at OSCON

About a week ago, the call for proposals for the Open Source Conference closed. It's a bit fuzzy because many people only realize what month (or year) it is only after the submission link disappears, so we let a few extra proposals slip in. Don't ask now: it's too late. For reals this time.

As part of the Perl Track committee, I just reviewed all of the proposals where the submitter marked it as a "Perl" talk. Several other people from the Perl track also reviewed them. There are going to be some very nice presentations this year, and at least one demonstration of highly advanced Perl technology that you'll want to see twice in a row, and maybe a third time at the end of the conference.

Forcing IE to accept script tags in innerHTML

So, my first blog post, and instead of Perl, I'm writing about Javascript.

I'm using a common idiom:

  • AJAX call returns HTML with embedded script tags
  • create a temporary <div>
  • div.innerHTML = request.responseText
  • move the children of the div to the appropriate spot
Firefox conveniently executes the script texts. Opera and Safari require extra steps to execute the script contents (eg, globalEval in jquery), and IE does whatever the hell it pleases.

IE usually works with globalEval, except when it doesn't.  I found that if the AJAX response was just a single script tag, then IE would filter it out.  But script tags were being created in certain circumstances.

Long story short, if you need to return a single <script> tag, wrap it in a <form> tag.  For whatever reason, IE will then accept it as innerHTML and create the script node, which you can then execute with globalEval or similar

Unhappy with @INC

Ever since I upgraded to Snow Leopard, my Perl has been unstable. I've fixed most of it, but I sometimes have strange behavior. Today I discovered why (and why didn't I notice this sooner?)

@INC:
/System/Library/Perl/5.10.1/darwin-2level
/System/Library/Perl/5.10.1
/Library/Perl/5.10.1/darwin-2level
/Library/Perl/5.10.1
/Library/Perl/5.10.0
/Library/Perl/5.8.9
/Library/Perl
/Network/Library/Perl/5.10.1/darwin-2level
/Network/Library/Perl/5.10.1
/Network/Library/Perl

Great. A bunch older Perl's have somehow made their way into my @INC. Time to recompile.

More CPANdeps jibber-jabber

Another coupla small updates to CPANdeps.

First, you can now collapse parts of the tree.

Second, a small bugfix for distributions with weirdo version.pm-stylee v1.2.3 versions. Thes dists are buggy, of course, as version *numbers* should be, well, they should be *numbers*. But as they're on the CPAN, I have to support them.

Now, can someone explain why this 'ere form what I'm filling in has seperate fields for "tags" and "keywords"? I thought that "tag" was just a stupid web 2.0 neologism for "keyword", so why are they seperate?

reading input from a file

hello...
i have recently started learning perl.....and having issues when i try to read input from another file. the details of a script that i tried to run are as follows:

i made a text file by the name "text.txt" and the contents were
Sidra|38|BE
Hira|48|BE
Shagufta|50|BE

Then i wrote the following script

open(DAT, "text.txt");
$data_file=" text.txt ";
open(DAT, $data_file);
@raw_data=;
close(DAT);
foreach $student (@raw_data)
{
chomp($student);
($name,$roll_no,$class)=split(/\|/,$student);
print "The student $name bearing roll number $roll_no is in class $class";
print "
\n";
}


the script produces no output and displays a message saying
"readline () closed filehandle at line "
I tried the same with another file by the name "text.dat" holding the same data but it did not work either. Please help me out resolving this issue.
Thankyou...

Contributing is easy!

I thought I would share my experience of submitting a module to CPAN for the first time. In summary: it's stupidly easy and if I can do it, so can you.

I'm not the best Perl coder and therefore I rely heavily on CPAN modules to do the real work. Every now and again I stumble upon bugs, many of which are simple to fix after a little debugging. However, some modules aren't heavily maintained and some haven't been touched in years. Bugs that are filed on RT can go unanswered, gathering digital dust while your development machine is riddled with heavily modified modules.

The solution? In my case it was as easy as discussing a few changes with the module author, who added me as a co-maintainer. That allows me to upload new versions, fix tickets in the bug queue and probably many other things I've not discovered.

POE Palm Sync Monitor

I am weird.

i have a Motorola Droid and a first generation iPhone which I use on WiFi only. But I really can't get myself to use either of them for task management.

Nothing beats the feel of my Palm Tungsten C keyboard. And nothing really beats the simplicity of the Palm ToDo List. Well, not really nothing, but you know what I mean.

I was surprised and happy to notice active development still taking place on p5-Palm. Today, I decided to resurrect an old project I had started to create a Palm Sync daemon on my home server.

First, I confirmed that pilot-link was up and running on my server. Next, I refreshed my memory on the commands used to run a WiFi sync.The first step is to make sure the user of the Tungsten C and the user of pilot-link are one and the same. This overwrites the user on the device, so proceed with caution.

pilot-install-user -p net:any -i 1000 -u mike

Updates for Net-Amazon-MechanicalTurk

I noticed How can I fix Net::Amazon::MechanicalTurk's failing tests? on Stackoverflow. There are a couple of patches in RT and another one on Dave Viner's blog under Amazon Mechanical Turk Perl Library Error. I applied the patches and uploaded an unauthorized release so CPAN Testers can have a wack at it.

If you are the author of this module, use it, or otherwise have an interest in its health, please let me know. I don't use it at all, but I know how to make broken distros work again. There are still lots of problems, but I only did the minimum to get the tests to pass.

Frozen Perl 2010: Days -3..-1

The drive Wednesday up to St. Paul went well, no major meltdowns or fussing.

Had dinner at the Blue Door Pub. I had the Jiffy burger and a bunch of good beer. A bit too much peanut butter for my taste. The Purvis at XXX seems to have a better balance of peanut butter to burger.

Thursday was mostly focused on getting to Punch for lunch. We then had Taste of Thai for dinner.

Friday was awesome. I took brian d foy's Effective Perl Programming class. Nothing like beta testing (more like alpha since brian did mention this was the first time teaching it) a class. Since I've taking his Mastering Perl class a couple years ago at OSCON I would say half the content was familiar from that and general Perl stuff I've done/read about. The rest was golden (mostly Unicode stuff). I'm looking forward to the second edition of the book that the class is based on.

Tracking Down Bug Reports

I often find that test reports I get from smokers are not terribly useful for failures. Sometimes it's obvious. Other times it's not. One thing which helps a bit is this bit in your t/load.t test:

diag(
    "Testing My::Module $My::Module::VERSION, Perl $], $^X"
); 

In the CPAN testers reports, you can click on a test report and instantly see the module version, Perl version and path to the current Perl (arguably not as useful).

I like to go a step further and include information about all modules I claim to require. For my t/00-load.t for Test::Most, I have the following:

distributed data analysis and reporting and perl, ...

so I was asked this question regarding our users and our products
and such. wanting a quantitative numerical result,
- I quickly (less than 5 minutes) wrote up a map-reduce (+ reduce) job,
- submitted it to our array of servers,
- and in less than 10 seconds, I had the answer.

actual job code (names changed):

Sense & Maintainability

There is empirical evidence that Perl is an inherently maintainable language. The Software Productivity Research group have published 2 comprehensive surveys of programmer productivity across different languages and problem domains. One was published in 1996, the other in 2006. The results in both are consistent - for overall perl productivity scores & when perl is compared against other popular languages.

Function points were used as the data collection method and the survey covered the whole dev lifecycle. The actual figures are not too important - suffice it to say that both surveys found that perl is far more productive than C & generally significantly more productive than Java.

SQL scores even higher, btw, albeit in its specialist field of relational data manipulation.

Productivity != Maintainability though?

True - but to be productive throughout the lifecycle the maintainability must be at-worst acceptable w.r.t to design,implement,test.

Naturally questions can asked of the method & the results. SPR themselves spell out the limitations, so take with appropriate seasoning. That said the consistency of the results might induce speculation on:

s3syncit - Ubuntu One and DropBox Replacement Written in Perl

For a while I have had two itches to scratch. Firstly, I wanted a simple set of libraries to interface to the Amazon Web Services. Secondly, by having those, I could do my own remote storage of various important files.

Almost 2 years ago I wrote the start of Project AwsSum in Perl. They are simple but they work and also come with some small command line tools which do as you want.

The itch for those interfaces has mostly gone. I do need to add some latest updates to the interfaces but they're ok in all honesty and those who want those new features would only take a few mins to add them :)

Remote Backup

The 2nd itch has been bugging me for a long time though. In the example folder of the repo there is a command line tool called s3bak and for ages I have been using it to store my files. However it has one major disadvantage, the pushing and pulling is manual.

CPAN Testers Summary - January 2010 - The Wedge

One month to go and work is progressing well on the transformation to CPAN Testers 2.0. Over the last month many changes to the websites have been visible, but just as many changes have been happening behind the scenes. The Metabase is a key part of the transformation, and although work has been going well, it is reaching the point where it'll need some serious testing prior to switch over on 1st march 2010. If you have the time, please join the cpan-testers-discuss mailing list or contact David Golden to let him know what you can help with. See David's CPAN Testers 2.0 mid-January update blog post for a more detailed status update.

Why you should create CPAN distros

On Tuesday, February 23rd, Jeff Thalhammer will speak on why you should create CPAN distros, even for proprietary code. He has worked on worked on several projects where all the private code was organized into CPAN-style distros, and then injected into a local copy of CPAN. They then used the CPAN tool chain to manage the entire build, test, and release process. Jeff Thalhammer's CPAN page: http://search.cpan.org/~thaljef/ Announcement posted via App::PM::Announce RSVP at Meetup - http://www.meetup.com/San-Francisco-Perl-Mongers/calendar/12509158/

Assorted

Some older articles from a (failed) attempt to compete in the Ironman Blogging Challenge. I’ll try to move them over here, although converting from Blogspot’s HTML (or even cleaning up said HTML) to Markdown is a hassle.

On Nagios, Thunk, Shinken and wrapper included marketing

Nagios is probably the most famous and used monitoring program on the market. It's free, GPL and has nice features such as object representation of data, inheritance, plugin systems, passive testing, built-in Perl interpreter, result caching, pipe interface, alert delegations and so on and so on.

When your mind becomes its own echo chamber

I was looking over my old notes recently - I have a file where I keep ideas for projects among other things. These notes are really of any kind: implementation details, user requirements that should be met, project naming ideas. Among the potential projects for some later day is a Twitter client, for which I kept some naming notes. The thought process behind them was to somehow combine “Twitter” with “Perl” (not necessarily in an obvious fashion). I had even arrived at a conclusion.

With the benefit of retrospect, I have no idea what I was thinking.

I had decided that the right name would be “Twipple”.

More design love please...

This is a follow up, or rather extension to xSawyerxs Marketing the Entire Box (including the wrapper)

I completely agree, design is the first thing people notice about a project. If you do not put effort into the look of your projects web page then whether you like it or not it will have an affect on the perception of your project (and indirectly on Perl).

If someone (my list of projects is way too large at the moment unfortunately) has time I think there are two projects which would make a massive difference.

  • Provide a Creative Commons licensed design(s) that anyone can use for a Perl project. Lots of us are not designers, so even if we'd like to make our projects look better we don't know how!
  • See if it is possible to get CPAN redesigned, this is already the home to thousands of Perl projects, so improving this will have a massive impact.


Many of the Apple applications websites have a similar feeling (simple and clean), this is because they all use iWeb. Good design does not mean lots of design. It just means a clean page, and separating content under headings (rather than having a single page with everything just listed).

Miscellaneous Thoughts

Though 1: Test::Class::Most fails on Perl 5.010001 -- but only on Linux. Not on FreeBSD, OS X or Solaris. I've already emailed the testers and hopefully someone can track down what's going on. I don't want to say "bug in Perl", but this is not platform-specific code, so it looks suspicious.

Thought 2: Can anyone please explain to me why anyone would want to buy a whyPad?

Thought 3: What does the following print and why? Results are the same for 5.10.1 and 5.8.9, in case you're wondering. Try and figure out the output before you run the code. I now know why it does this, but I was confused by the behavior.

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.