I failed to pause before blogging

I got this email from PAUSE just now:

Failed: PAUSE indexer report BKB/Go-Tokenize-0.01.tar.gz

     module : switch

It looks like it doesn't like this line of code containing Go keywords:

chan         else         goto         package      switch

8 Comments

The PAUSE code to discover which packages you use is very simple because it doesn't want to run code. It does a static search for "package IDENTIFIER".

Although this won't help in your case, but that's why you sometimes see this trick:

package # hide from PAUSE
    foo;
It seems to me that PAUSE could check for a semicolon, but there are probably exceptions for that.

Indeed there are.

$ perldoc -f package | head -4
    package NAMESPACE
    package NAMESPACE VERSION
    package NAMESPACE BLOCK
    package NAMESPACE VERSION BLOCK

There is no reason the BLOCK has to be on the same line either.

Anyway, making sure you don't have anything following 'package' on the line is an appropriate solution in this case. And probably including a comment so the problem doesn't accidentally reoccur.

I think the indexer probably goes through line by line to avoid slurping in the whole file.

Leave a comment

About Ben Bullock

user-pic Perl user since about 2006, I have also released some CPAN modules.