#!/arudev/bin/perl use strict; my $file = shift or die "must supply body file"; open F, $file; my @text = ; my $text = join '', grep { ! /\s+\-{2,}/ } @text; my $regex = '(procedure|function)\b(.*?)\((.*?)\)'; while ($text =~ /$regex/gs) { print "*$1+$2-$3*",$/; }