Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

grantm (164)

grantm
  (email not shown publicly)
http://www.mclean.net.nz/

Just a simple [cpan.org] guy, hacking Perl for fun and profit since way back in the last millenium. You may find me hanging around in the monestary [perlmonks.org].

What am I working on right now? Probably the Sprog project [sourceforge.net].

GnuPG key Fingerprint:
6CA8 2022 5006 70E9 2D66
AE3F 1AF1 A20A 4CC0 0851

+ -

  Journal: BCVI 3.0 Hits CPAN on 2010.06.03 16:08

Journal by grantm on 2010.06.03 16:08
User Journal

My big news today is that Version 3.0 of bcvi is now available on CPAN. If you have no idea what bcvi is then you'll be pleased to know I've written this article to answer all your questions - it even has pictures!

Read More 1 comments
Comments: 1
+ -

  Comment: I use q{} (Score 1) on 2010.02.02 2:05

by grantm on 2010.02.02 2:05 (#71612)
Attached to: Hint: Formatting SQL in Perl code

I've never been a big fan of heredocs - mainly because they break indentation. When I put SQL in code, I tend to use the single quote operator with curly braces for delimiters:

$sql = q{
    SELECT
            *
    FROM foo
    WHERE
          id = $1
};

Read More 2 comments
Comments: 2
+ -

  Comment: Not all virualisation solutions are equal (Score 1) on 2009.12.06 15:43

by grantm on 2009.12.06 15:43 (#71324)
Attached to: when virtualization is too expensive

I've been a heavy user of Linux vservers (see also: OpenVZ and the other one whose name I forget; and BSD 'jails') for a number of years. They are similar in concept to your chroot solution except much more convenient to use. They are lightweight because the virtual servers don't run their own kernels - they share the host kernel but with key structures like the process table partitioned into separate namespaces.

I've found this type of virtualisation to be invaluable in the 'staging' or 'User Acceptance Test' environment. If an application will be split across multiple servers in production (eg: DB server, app server, frontend web server), then you really want your staging environment to be configured the same way. Doing it with virtual servers is a cheap and effective solution.

Read More 2 comments
Comments: 2
+ -

  Comment: Another plus for following standards (Score 1) on 2009.11.05 14:59

by grantm on 2009.11.05 14:59 (#71048)
Attached to: Using CPAN's Toolchain to Improve Your Code
Another advantage of using CPAN packagaing standards for code that's not going to CPAN is that it's really easy to create packages for deploying the code on Debian/Ubuntu (and presumably RPM-based distros' too - I don't know). The dh-make-perl utility takes a CPAN tarball and creates a .deb package.
Read More 5 comments
Comments: 5
+ -

  Comment: Is the space magic? (Score 1) on 2009.09.30 15:20

by grantm on 2009.09.30 15:20 (#70718)
Attached to: ImageMagick / convert / --no-globbing!
Is the space actually 'magic' or it simply that you have no filenames that end with a space?
Read More 7 comments
Comments: 7
+ -

  Comment: Sounds like it would be very platform-specific (Score 1) on 2009.09.25 4:35

Personally, I'd just pipe those things through Encoding::FixLatin and enjoy the utf8ness it emits :-)
Read More 8 comments
Comments: 8
+ -

  Journal: Another reason to switch to Git on 2009.09.16 4:21

Journal by grantm on 2009.09.16 4:21
User Journal

If your project was in Git then you could use Gource to visualise the commit history.

Gource is written by Andrew Caudwell - a colleague and sometime Wellington Perl Monger. He loves playing with graphics and interesting visualisations. If you're running Ubuntu/Debian you can even grab a .deb from the project 'Downloads' page, install it, cd into your git project and run gource - then sick back and what history.

Read More 2 comments
Comments: 2
+ -

  Comment: Re:Git support on Sourceforge is very minimal (Score 1) on 2009.08.24 20:19

by grantm on 2009.08.24 20:19 (#70249)
Attached to: Whither SourceForge?
It looks like SourceForge have fixed this problem and now projects can have multiple git repos. Unfortunately at this moment all git URLs on their site are broken as what was git://project.git.sourceforge.net/gitroot/project should now be: git://project.git.sourceforge.net/gitroot/project/project
Read More 14 comments
Comments: 14
+ -

  Comment: Great Stories (Score 1) on 2009.08.18 14:39

by grantm on 2009.08.18 14:39 (#70149)
Attached to: Sudden involuntary cosmopolitan

These are the experiences that life is made of.

By the way I don't think you need worry about the dangers of having a credit card. It would only get you into trouble if you used it to spend money you don't have and it doesn't sound like you're the sort of person who would do that. As long as you make sure to pay off the full balance every month then a credit card will be nothing more or less than a useful tool.

Of course this would have been a much shorter story if you'd had a credit card :-)

Read More 6 comments
Comments: 6
+ -

  Comment: Git support on Sourceforge is very minimal (Score 1) on 2009.08.17 15:56

by grantm on 2009.08.17 15:56 (#70118)
Attached to: Whither SourceForge?
Yes, Git support was added to Sourceforge recently, but the support is very minimal - one repository per project. I like to use one repo for the project itself and another for the web site. Some projects (e.g.: Perl-XML) use the CVS modules facility to have one repository per distribution. Subversion kind of supports this through its "tag-isa-branch-isa-module-isa-directory" model. In Git you could have completely independent branches for different purposes but that just seems wrong.
Read More 14 comments
Comments: 14
+ -

  Comment: I prefer XPath (Score 1) on 2009.08.12 20:17

by grantm on 2009.08.12 20:17 (#70027)
Attached to: Data::AsObject Released - Data Structures Made Easy
For that type of problem, I find that using XML::LibXML and XPath leads to code with even less syntax.
Read More 3 comments
Comments: 3
+ -

  Comment: "Perl without threads" ? (Score 1) on 2009.06.01 17:15

by grantm on 2009.06.01 17:15 (#68901)
Attached to: 148 newly installed, Do you want to continue [Y/n]?
I'm interested in your reasoning for running "Perl without threads". I've done a lot of work with developing and deploying Perl and mod_perl apps on Debian and have yet to find a reason to build my own perl executable. Does building a Perl without threading support have some advantage over the core build?
Read More 9 comments
Comments: 9
+ -

  Comment: Another example (Score 1) on 2009.04.15 4:35

by grantm on 2009.04.15 4:35 (#68129)
Attached to: On simple stuff and bad religions
Another example that people may be able to relate to, is scanning an Apache log file and using the hash to count which pages were visited.
Read More 6 comments
Comments: 6
+ -

  Comment: What are your requirements? (Score 1) on 2009.03.21 13:45

It might help to answer your question if we knew what you want to do with the tree.

One of the disadvantages of a complex tree structure is the tedium of navigating it to access the data you want. In the XML world, the XPath query language is great for pulling data out of the DOM tree. So having a parser that uses a generic tree module without XPath support doesn't sound particularly appealing.

The most popular XML module is probably XML::LibXML. Its tree nodes and XPath query engine are implemented in the libxml2 C library. This has a huge performance advantage over modules that implement their tree with Perl data structures since Perl has more overheads.

Read More 6 comments
Comments: 6
+ -

  Journal: The 'Faces' of Wellington Perl Mongers on 2009.03.20 20:47

Journal by grantm on 2009.03.20 20:47
User Journal

Wellington Perl Mongers had a fun evening last week - our annual Lightning Talk meeting. As usual the talk schedule was looking pretty thin in the days leading up to the event but with a bit of encouragement people did step up and the evening went well. The talks covered a range of Perl modules; a bit on Erlang and CouchDB (thanks Lenz); mountain biking and mapping (Donovan); and Perl on the iPhone (Tob

Read More 1 comments
Comments: 1