Update Needed to the old package

Hi everyone,

Sad to say that the Padre packages on wildperl are out of date. I’m hoping to get a chance to update them in the next few weeks, but until then there is a good chance they don’t represent the state of the art on OSX.

It probably makes sense to build from source until then.

My thanks.

Tom

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

$DB::single = 1 : Make that debugger stop where you want it

Sometimes it’s useful to get a perl debugger to stop exactly where you want it to stop.

When debugging on the command line I’ve got a relatively manual process of bringing up a debugger, use-ing my module of choice if it’s not already loaded, breaking at a method name, continuing, then breaking at the line I want. It’s likely there is a better way to do this, but I haven’t found it yet because I usually just insert a

$DB::single = 1;

expression exactly where I want it.

I’m sure most people know about this, but if you don’t, take a look at

$ perldoc perldebug

and pay attention to the section describing

$DB::single = 1;

Inserting that expression will make the perl debugger stop on that line when it’s reached. You can just fire up your program or test case in the debugger and let it run.

Also useful could be wrapping that statement in a condition that checks for your particular case or iteration.

The perl debugger is filled with other great magic, but I find $DB::single is a feature I use often.

 

 

 

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

OSX Package for Padre 0.92

I’m happy to provide the osx dmg for the latest Padre Perl IDE release, 0.92. The march to 1.0 continues thanks to the great work done by the Padre team! As usual, I used the Cava Packager to bundle the CPAN Padre with a few core plugins.

Please check this page for the latest package, and info on how to report bugs.

We would appreciate any testing you do on OSX, and please report bugs you run into. Why not stop by #padre and say hi while you download?

Note: Padre on OSX still has a number of rough edges.

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

Brewing aspell for emacs on OSX

A reminder to myself and a help for anyone trying to get ispell to work on OSX Emacs.

You can brew an install of aspell:

brew install aspell --lang=en

If you forget the –lang you may end up getting errors like:
Error: No word lists can be found for the language “en_US”.

I saw elsewhere that there may be some brews for the dictionaries themselves, but I didn’t see that on my system and didn’t investigate too much, since –lang worked fine on install.

To get emacs to use aspell, you just need to add this to your .emacs:

(setq-default ispell-program-name "/usr/local/bin/aspell")

That’s about it.

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

printing lists versus concat strings? a little nibble of a benchmark

Please check out the comments to see more information about this topic.

Going to put this out there because I saw some code the other day that printed comma separated strings and scalars, and it got me curious about how expensive it was to print a list of items, rather than concatenating them into a string and passing that to print.

I’ll let the code speak for itself:

 my $x = 'test';
 my $r = timethese(
 10000000,
 { 
 'commaprint'    => sub { print STDERR 'test', 'test', 'test', 'test', 'test', 'test'; },
 'varcommaprint' => sub { print STDERR $x, $x, $x, $x, $x, $x; },
 'interpprint'   => sub { print STDERR "$x $x $x $x $x $x"; },
 'concatprint'   => sub { print STDERR 'test' . 'test' . 'test' . 'test' . 'test' . 'test'; }, 
 'singleprint'   => sub { print STDERR 'test'; },
} );

And the result on my laptop:

commaprint: 33 wallclock secs (12.46 usr + 19.77 sys = 32.23 CPU) @ 310269.93/s (n=10000000)
varcommaprint: 32 wallclock secs (12.76 usr + 19.74 sys = 32.50 CPU) @ 307692.31/s (n=10000000)
interpprint: 10 wallclock secs ( 7.44 usr +  3.68 sys = 11.12 CPU) @ 899280.58/s (n=10000000)
concatprint:  6 wallclock secs ( 3.02 usr +  3.58 sys =  6.60 CPU) @ 1515151.52/s (n=10000000)
singleprint:  6 wallclock secs ( 2.97 usr +  3.52 sys =  6.49 CPU) @ 1540832.05/s (n=10000000)

I’m not completely surprised by the result, but I would’t want to speculate about what’s going on under the covers without spending time studying the perl code. For now this will just have to leave this out there as something to consider in the future.

 

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

Padre 0.90 OSX dmg

I’m happy to provide the osx dmg for the latest Padre Perl IDE release, 0.90. The march to 1.0 continues thanks to the great work done by the Padre team!

Please check this page for the latest package, and info on how to report bugs.

We would appreciate any testing you do on OSX, and please report bugs you run into. Why not stop by #padre and say hi while you download?

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

Padre 0.88 OSX dmg

I’m happy to announce that Padre 0.88 is available as an OSX dmg.

Along with all the amazing work Padre folks have been doing to release 0.88, we’ve also been hunting down critical OSX bugs that surfaced during the recent weeks.

There is some more TLC that needs to be given to the Padre codebase for OSX. Thus, along with the known OSX defects, I anticipate we’ll continue to find more issues that need fixing.

That’s why we need you to try the Padre 0.88 dmg, and let us know if you have any issues, crashes, or feature requests. I hope Padre on OSX will be on par with linux and windows by the 1.0 release with your help.

Bug reports can be made most easily by hopping into #padre on irc, or even commenting on this blog post.

Thanks:
I want to thank Mark for doing the work to develop the packaging project for Padre using Cava, and for his help with some of the gnarly issues I ran into these past weeks.

Also, thanks to the folks who reported bugs in the 0.86 dmg (that have been solved I hope), and to everyone on #padre.

Want to run Padre on OSX from source?
You can use the bin/padre-brew.pl script found in the padre-brew github to create a perl+padre on OSX.

If you’re on windows or linux, see the 0.88 release announcement.

 

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

padre-brew now supports OSX LION (Build your own Padre on OSX)

My padre-brew script, which creates a standalone version of perl (32 bit) + wxWidgets + Padre, has been updated to support OSX Lion. Currently it supports OSX out of the box, and does work on Linux though you’ll need to get wxWidgets working your system first.

You can have a look at the github here: http://bit.ly/oiME1I

If you want to try Padre on OSX (warts and all, we’ve got a long way to go on OSX), all you need to do is grab the source and run:

./bin/padre-brew.pl --no-test

That will create a PadreApp directory, with a padre script you can run. As always thanks to Mark @ Cava for doing all the hard work to get all the build flags, etc. All mistakes are my own.

Tom

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

Brain-Dead Moment of the day or… is IE9 trying to display your ajax result and double-submitting your forms?

A non-perl post but something that bugged me for a few hours today until:

I had an ajax-handled form that was working fine for ages, but when run under IE9 it would display the result of the ajax request, or try to download the ajax (when the content type was set to application/json).

Sadly, we didn’t have IE9 in our testing setup for this bit of code (our Windows machine was XP Pro, and that cannot have IE9 it seemed), so we got this as feedback from my co-worker when he got a new machine recently. (The shame is large).

Once I got the test machine updated and running IE9, it was clear the form was being double-submitted, and the result of the second submission was being displayed. hmmmm…

On that one form (oops) I had forgotten to set onsubmit=”return false;” in the form. The Ajax handler was returning false, and also stopping the event, but for some reason IE9 was submitting that form.

Adding onsubmit=”return false;” solved my problem (and that’s our S.O.P. that was missed for this form). Hope that helps!

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon

Padre on OSX DMG – Now on Leopard, Snow Leopard, and Lion

Please use the 0.88 DMG.

Below is the old 0.86 post for reference.


Thanks to Mark @ Cava for giving me the perl build line needed to produce Padre packages that work on the latest three OSX versions.

You can now grab the latest OSX Padre packages (0.86) with a few plugins embedded, at:

http://wildperl.com/wp-content/uploads/Padre/0.86/padre-osx-uni-0-86-0.dmg

I plan to post a complete ‘how go build and package Padre on OSX’ post (and/or wiki page on Padre trac) as soon as I update my padre-brew.pl tool for Lion.

If you’re interested, I now build perl with this command:

perlbrew install 5.14.1 -ders -Dusethreads -Duseithreads -Accflags="-arch i386" -Accflags="-B/Developer/SDKs/MacOSX10.6.sdk/usr/include/gcc" -Accflags="-B/Developer/SDKs/MacOSX10.6.sdk/usr/lib/gcc" -Accflags="-isystem/Developer/SDKs/MacOSX10.6.sdk/usr/include" -Accflags="-F/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks" -Accflags="-mmacosx-version-min=10.5" -Aldflags="-arch i386 -Wl,-search_paths_first" -Aldflags="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk" -Aldflags="-mmacosx-version-min=10.5" -Alddlflags="-arch i386 -Wl,-search_paths_first" -Alddlflags="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk" -Alddlflags="-mmacosx-version-min=10.5" -Duseshrplib

And I configure and build Alien::wxWidgets and Wx::Scintilla with the following build:

CFLAGS='-arch i386' CXXFLAGS='-arch i386' CPPFLAGS='-arch i386' LDFLAGS='-arch i386' OBJCFLAGS='-arch i386' OBJCXXFLAGS='-arch i386' perl ./Build --wxWidgets-extraflags=" --with-macosx-sdk=/Developer/SDKs/MacOSX10.6.sdk --with-macosx-version-min=10.5 " --wxWidgets-build='yes' --wxWidgets-source='tar.bz2' --wxWidgets-version=2.8.12

If you have bugs, please file them in track: http://padre.perlide.org/trac/wiki/osxbugs

All errors are my own.

Thanks!

Post to Twitter Post to Digg Post to Facebook Send Gmail Post to LinkedIn Post to Reddit Post to StumbleUpon