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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I want this. I *so* want this. The thing that bothers me is that I'd like to do some sane defaults for @INC because it becomes very difficult to validate modules or things using modules that aren't installed by the ambient or shebang perl.

    I'm thinking that just autoadding lib/, t/, uh... t/lib would be spiffy. Perhaps with some dwimmery to notice if those directories can be found by navigating up the directory tree:

        ~jjore/src/Foo-Bar/t$ ... # automatically find ../lib

    Maybe there oughta be some data in a ~/.whatever file to allow a person to specify what happens when under certain paths.
    • I'm thinking that just autoadding lib/, t/, uh... t/lib would be spiffy.

      That's a functionality that has been present in Perl for ages. It's called PERL5LIB.

      • Oh, well duh. *slaps head*. I was going to look first and then populate PERL5LIB but I don't have to look first. Perl will do that for me.
    • I downloaded flymake.el from their repository, but I wasn't able to make it work with my Emacs 21.2.1. I don't have the lisp-fu to figure it out, so I'll probably just wait until Emacs 22 is released.

      Putting aside the argument about compiling untrusted code, you should be able to get the effect you want by putting "use criticism;" at the top of your script. In the latest release of criticism.pm, we changed the default output format to look exactly like the perl's native compiler warnings. So when you r

      • Ok... but `use criticism' only works when you run the code.
        • Not so. It is pragma-like, so it executes when you compile the code. Observe what happens when you say "perl -c" on a file with "use criticism;"

          -Jeff

          • Well yeah, that's what I said. -c is a form of running the code.
            • I thought that's what you were shooting for -- running perlcritic at compile time. But if not, then I understand. My apoligies.

              Perhaps we could repurpose the flymake code and just substitute "perlcritic" where it says "perl -c". But your lisp skills are far better than mine.

              -Jeff

              • I thought you were proposing running perlcritic instead of perl -c + the criticism pragma. So it appears I was already at the endgame.