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 som
    • 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.
  • All I have to do now is send you a perl script to "look at" that contains:
    BEGIN { system 'rm -rf $HOME' }
    and hope that you look at it in your editor. That flymake code will nicely execute that system operation. Oops!
    --
    • Randal L. Schwartz
    • Stonehenge
    • Yeah, I had thought of something like that. Yikes! :-)

      On my mental todo list is to check if flymake does a check right after load, or only after a first edit.
    • And then I just "git clone" my homedir again, and you go to prison again.
      • I continue to be amazed at how friendly you are in person.

        • I'd be amazed and pleasantly surprised by his not spitting on people in person. Who digs up a 3-year-old journal entry to take a cheap shot at someone related to something they did 15 years ago? I'm not sure that even greater internet fuckward theory can explain it.

  • I tried it, but out of the box it only recognized .pl files (can be customized to recognize .t and .pm of course) and -- more annoyingly -- whenever it found an error, it moved the point from wherever I was writing bad code to the first syntax error it could fine.

    This invariably led to me typing something like:

    my $my_long_vari

    then pausing to think, and it would just pop me over to the closing ; somewhere completely uninteresting to me.

    Way too intrusive in other words.

    It seems that kind of thing should be cu