Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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?
[Lady_Aleena]: atcroft. maybe look at raw PODs. There is also L<foo|http://foo. com> and some might be linking directly to meta::cpan.
[Lady_Aleena]: Oops, didn't read the L<text|url> right.

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2017-05-27 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?