Tim King
- Website: sd.jtimothyking.com/
- About: I've been working almost exclusively with Perl since 2006, and am one of the founding staff at The Perl Shop. I believe in designing systems that are easy to use, easy to understand, and easy to extend. I love software that does what you want, when you want it, without fighting you every step of the way.
Recent Actions
-
Commented on How Viable is Perl?
Yes, that makes a lot of sense. (Someone on the TPS blog commented the same thing, too. LOL.)...
-
Commented on How Viable is Perl?
Truthfully, that was my thought as well. But it got me to thinking about whether more people are using Haskell than Perl (5), or whether more people are learning Haskell than Perl....
-
Posted How Viable is Perl? to Tim King
A few months ago, John D. Cook wrote about the viability of unpopular programming languages.
His story starts with a comment about Perl 6, to which someone replied, "Does anyone actually use Perl 6?" (or words to …
-
Commented on Long Import Lists (and available strategies for managing them)
Yes! That's it. (I had to run it through perltidy to make sense of it, but that's the code.)...
-
Commented on Long Import Lists (and available strategies for managing them)
Exporter::Tiny: good tip. (Unfortunately, this depends on the implementation of the package being used. That kinda sucks.)...
-
Commented on Long Import Lists (and available strategies for managing them)
However... (Thinking out loud here.) It might be possible to use this with another technique to achieve the desired effect. BEGIN { my $bak; *A:: = $bak; BEGIN { $bak = \%A::; *A:: = \%a::b::c::d::e::f::; } sub A { return...
-
Commented on Long Import Lists (and available strategies for managing them)
That's close, and it brings us part of the way there. But it only aliases during the compile phase. It's more akin to localized aliasing, because the aliasing disappears as soon as *A:: = $bak runs. For example: BEGIN {...
-
Posted Long Import Lists (and available strategies for managing them) to Tim King
I ran across this the other day while writing some sample code for the next chapter of Testing Strategies for Modern Perl.
How can we use long …
-
Posted Why Programmers Use the Test Hierarchy Antipattern to Tim King
The first part of this series described Test Hierarchy, a hierarchy of test classes that mirrors the classes under test, and explained why it’s an antipattern.
-
Posted Testing Insights from B::DeparseTree to Tim King
rockyb’s recent post about B::DeparseTree contained several insights on testability and writing good tests. Here are my takeaways.
-
Posted Test Hierarchy Produces Poor Unit Tests to Tim King
The first part of this series described Test Hierarchy, a hierarchy of test classes that mirrors the classes under test, and explained why it’s an antipattern. For how common it is, this…
-
Posted Test::Class Hierarchy Is an Antipattern to Tim King
Test::Class
is particularly good at testing object-oriented code, or so it is said. You can create a hierarchy of test classes that mirrors the hierarchy of classes under test. But this pattern, common in Perl projects, is conspicuously missing from the rest of…
Comment Threads
-
Toby Inkster commented on
Long Import Lists (and available strategies for managing them)
If the module uses Exporter::Tiny, then you'll get your "Export a hash of symbols" solution for free.
For example, List::MoreUtils uses Exporter::Tiny, so you can do this:
use v5.10; use strictures;
my %LMU;
use List::MoreUtils { into => \%LMU }, -all;# calls List::MoreUtils::uniq()
say for $LMU{uniq}->(qw/foo bar foo baz/);
-
Yang Bo commented on
Long Import Lists (and available strategies for managing them)
That's an interesting technique, I also found out that it's a good way
use JSON::PP; sub JSON::PP { 'lol' } my $obj = JSON::PP->new;
This actually fails, so by declaring a subroutine named PP in the JSON
package, JSON::PP, a technically completely unrelated module becomes
dysfunctional.Well, get back to the topic, it's good enough, I think I got it:
use strict; use warnings; use feature 'say'; sub A::g { say 'I am A::g.' } sub a::b::c::d::e::f::g { say 'I am a::b::c::d::e::f::g.' } sub B::g { say 'I am B::g…
-
Karl Williamson commented on
How Viable is Perl?
Tutorials for the board game Go are likely to have been searched for
-
Johan Vromans commented on
Long Import Lists (and available strategies for managing them)
Unfortunately the code stopped working in recent versions of Perl...
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.