johnxpan has asked for the wisdom of the Perl Monks concerning the following question:

I am setting up my perl developing environment. I used the cscope/ddd/emacs for my C/C++ development. Applying ddd/emacs to perl is piece of cake. But I can't find any information about how to use cscope for perl. In the cscope wikipage (http://en.wikipedia.org/wiki/Cscope) I did find the following claim: cscope is often used to search content within C or C++ files, but it can be used to search for content in other languages such as Java, Python, PHP and Perl. Does any of your gurus know how to use cscope with perl? Thanks;

Replies are listed 'Best First'.
Re: cscope & perl
by rcaputo (Chaplain) on Mar 22, 2011 at 19:37 UTC

    The magic that I didn't see on this thread is how to invoke cscope to build the database:

    find /home/troc/project/foo -name '*.pl' -o -name '*.pm' -o -name '*.t +' | grep -v blib | cscope -b -q -i -
    I read on the web that cscope only pays attention to C-style file extensions unless you find and include specific files yourself.

      Might be a bit easier to do:

      ack -f --perl | cscope -b -q -i -
      Having done that, my editor doesn't take cscope output - but it does tack ctags output, so same idea:
      ack -f --perl | ctags -L -
      If you don't have ack, you should. It's written in perl, and is way easier to use than grep, with way more functionality.

Re: cscope & perl
by Anonymous Monk on Jun 24, 2009 at 09:47 UTC
    cscope usage doesn't depend on the target
      Thanks for the prompt reply, I managed to created the cscope file for my perl codebase, but it doesn't load to emacs at all. Any idea?
        Hi John, How did you create the cscope db for your perl source code? I am looking for the same thing (although with vi). Can you share some info? Pari
        Sorry, don't use emacs :/
Re: cscope & perl
by jplindstrom (Monsignor) on Jun 26, 2009 at 11:01 UTC
    Never heard of DDD (debugger frontent) before, but it sounds interesting.

    Do you use it as a frontend to gdb, or to GUD/perldb?

    /J

      Its not exactly a frontend to gdb. It's another frontend like gdb. It is gui based unlike the term based gdb. Pari
        Just looked at the DDD website and I stand corrected - "GNU DDD is a graphical front-end for command-line debuggers such as GDB, DBX, WDB, Ladebug, JDB, XDB, the Perl debugger, the bash debugger bashdb, the GNU Make debugger remake, or the Python debugger pydb." Pari