News for hackers. Stuff that matters.
Re: How I learnt to love Perl by DavidMcLaughlin on Sunday December 07, 2008 @03:44PM (#389104)
I didn't say I liked anything in Perl better than Python. There may be a couple of things, but it would just boil down to personal taste.

Conversely, I like Python better than Perl in two major departments though:

1) The way you import stuff in Python. If you have a long namespace in Perl you have to type it out every time you instantiate an object. Example:

use Organisation::Project::App::Models::Feature;

my $feature = Organisation::Project::App::Models::Feature->new();

In Python you would do: from organisation.project.app.models import feature;

feat = feature();

It's a small point, but when you have multiple views/actions inside a controller that all use the same model you start to get annoyed typing that namespace in Perl.

2) The native OOP system in Python is much easier than Perl. With Moose this is far less important than it used to be, but comparing core Perl to core Python it is an issue.

Re: How I learnt to love Perl by draegtun on Sunday December 07, 2008 @06:07PM (#389224)
Yes its seems common for Perl libraries in commercial environments to get very long and come a right PITA ;-(

However check out the excellent "aliased" module... http://search.cpan.org/dist/aliased/

From its POD...

  use aliased 'My::Company::Namespace::Customer';
  my $cust = Customer->new;

  use aliased 'My::Company::Namespace::Preferred::Customer' => 'Preferred';
  my $pref = Preferred->new;
Re: How I learnt to love Perl by DavidMcLaughlin on Sunday December 07, 2008 @06:21PM (#389241)
CPAN strikes again, I was actually hoping someone would show me a better way when I posted that. So thanks!