Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Grepping the whole of CPAN

by dmitri (Curate)
on Jul 12, 2007 at 01:33 UTC ( #626124=perlquestion: print w/ replies, xml ) Need Help??
dmitri has asked for the wisdom of the Perl Monks concerning the following question:

Dear Brethren,

being the maintainer of the Perl part of ctags, I get very interesting bug reports from time to time, for instance this one.

I would consider the snippet of code below a very rare (read: nonexistant) occurence. I mean, who would use __END__ as the terminator for a here-to document? The best way to test my assumption would be to grep the whole of CPAN...

Question: what is the best way to "grep" CPAN?

Thank you,
  - Dmitri.

Snippet from the bug report:

package a; sub abc { print "abc"; } sub def { print <<__END__; def __END__ } sub ghi { print "ghi"; } 1;

Comment on Grepping the whole of CPAN
Download Code
Re: Grepping the whole of CPAN
by jasonk (Parson) on Jul 12, 2007 at 02:02 UTC

    http://www.google.com/codesearch/. The best part is that you don't even have to limit it to CPAN, just use "lang:perl" as part of the search...


    We're not surrounded, we're in a target-rich environment!
      Thank you! I did not know about this resource. It works beautifully.

      And, apparently, there are people who use __END__ for here-to docs...

Re: Grepping the whole of CPAN
by Corion (Pope) on Jul 12, 2007 at 06:30 UTC

    Also, if you have a CPAN::Mini mirror locally, you can apply diotalevi's patch to File::Next and then use ack to grep through the archives of your CPAN mirror. Likely, Google code search is quicker though...

Re: Grepping the whole of CPAN
by holli (Monsignor) on Jul 12, 2007 at 11:00 UTC
    Show me a Perl programmer who does that and I'll do something evil to him
    That was exactly my thoughts. __END__ is a reserved word and you don't use a reserved word as a delimiter. period.

    (It works with other reserved words, but that's not the point.)


    holli, /regexed monk/

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://626124]
Approved by shigetsu
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-07-12 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (238 votes), past polls