in reply to Responsibilities of a module author

I think this is part of the reason why some Perl authors only want to rely upon the "core" modules -- there's a minimum committment from the Perl porters to maintain it.

Alas, even this is not true. Yeterday I spent over an hour tracking down an obscure bug in a script a fellow worker wrote. To make a long story short, the problem was in Switch, a core module. This bug was reported about 3/2004 and is not likely to be fixed anytime soon. I'm not whining here about this - I'm just pointing out that:

  1. You need to be careful when using modules, even core ones.
  2. Sometimes bugs are left alone because they are too damn hard to fix. Sad, but true :(

A short thread on p5p starts here.

  • Comment on Re: Responsibilities of a module author

Replies are listed 'Best First'.
Re^2: Responsibilities of a module author
by tirwhan (Abbot) on Nov 24, 2005 at 14:06 UTC

    Umm, define "core". The perldoc to Switch states "There are undoubtedly serious bugs lurking somewhere in code this funky" and then goes on at some lengths about the limitations of source filters. TheDamian (the original author) categorizes Switch as a module " shouldn't use in production...", because it's an experiment. Given that, it'd take some pretty serious convincing for me to use the module for anything serious(especially since the functionality it implements is otherwise available).

    Update: itub defined "core" for me, thanks :-). I missed it because isn't listed at the perl.5.8.7 page at, though the download does contain it. Curious indeed.

    Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan
      It is "core" because it comes with the perl distribution. People tend to (sometimes mistakedly, I have found!) trust those modules as more stable and reliable than the modules that are only found on CPAN. Why is it in the core if shouldn't be used in production? I don't know, but my guess is that it was a response to all the people who complain that Perl doesn't have a switch statement.
        Its a mistake that Switch is in core, but once in core, always in core.
Re^2: Responsibilities of a module author
by atcroft (Abbot) on Nov 24, 2005 at 15:13 UTC

    Under the "Limitations" section of the Switch documentation, it states,

    Due to the heuristic nature of's source parsing, the presence of regexes specified with raw ?...? delimiters may cause mysterious errors. The workaround is to use m?...? instead.
    That sounds like it might be an avenue to explore to help resolve your issue.

    Hope that helps.