Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: heuristic to detect (perl) code

by 7stud (Deacon)
on Jan 20, 2013 at 09:22 UTC ( #1014264=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $count = ($line =~ s/[#] .*? \n//xms);
    $total += $count;
    
  2. or download this
    $line =~ s/["'] [^'"\n] ['"]//gxms
    
  3. or download this
    $count = ($line =~ s/use [^;]+ ;//gxms);
    $total += $count;
    
  4. or download this
    my $count = ($all_text =~ s/<<(\w+) .*? \1//gxms); 
    $total += $count;
    
  5. or download this
    $total++ if $all_text =~ s/(__DATA__|__END__) .*//xms;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-11-24 00:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (134 votes), past polls