Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 romping around the Monastery: (17)
As of 2015-07-29 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls