in reply to Scanning a plsql package body to make package headers... regexp requested

And for posterity, here is my final version which correctly handles function and procedure text:
#!/arudev/bin/perl use strict; my $file = shift or die "must supply body file"; open F, $file; my @text = <F>; my $text = join '', grep { ! /\s+\-{2,}/ } @text; my $p_regex = '(procedure\b.*?\(.*?\))'; my $f_regex = '(function\b.*?\(.*?\)\s+return\s+\S+)'; while ($text =~ /($p_regex|$f_regex)/gs) { print "$1;\n"; }
  • Comment on Re: Scanning a plsql package body to make package headers... regexp requested
  • Download Code