http://www.perlmonks.org?node_id=151090


in reply to (jeffa) Re: Favourite modules
in thread Favourite modules March 2002

Not airtight, but it will skip the POD.
my $in_pod=0; my $argcount = scalar @ARGV; while (<>) { # deals with uncorrect POD left open at the end # of the file if ($argcount > scalar @ARGV) { $in_pod=0; $argcount--; } if ($in_pod) { $in_pod = not /^=cut/; } else { $in_pod = /^=\w/; } next if $in_pod; # skip lines inside POD $mod{$1}++ if /use\s+([A-Za-z_:]+);/; }