Class-Classgen-classgen

 view release on metacpan or  search on metacpan

Comments.pm  view on Meta::CPAN

	my ($line) = @_;

	$line=~m/(^[^#]*)(.*)/;
	return ( $1, $2 );	# $1 source text, $2 comments
}

sub repair_header {	# to put in missing ';' in the header section
	my (@code) = @_;	# the code edited into the header section
	my @code2;

	shift @code;			# remove fragment
	foreach (@code) {
#		next if( $_=~m/:/);	# this is an identifier for the sect.
		unless ( $_=~m/;/ ) {	# then find insertion point
			if($_=~m/#/){	# case where comment is present
				$_=m/(^.*)(\s*)#(.*)/;
				push @code2, ($1 . $2 . ";#$3\n");
			}else{		# case without comment
				chomp;
				push @code2, ($_ . ";\n");
			}



( run in 1.162 second using v1.01-cache-2.11-cpan-364913b4093 )