brianarn has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I've gotten stuck with something, and I'm having trouble finding a good fix.

Over at Script Generator, I posted some code that generates template scripts for me to work from, and it seems to work just fine, unless I try and use a -h or -m option, which I set up to use Pod::Usage to parse my pod and display a quick help or manpage.

However, my template script generates a good chunk of pod, and I used a heredoc to quote the bigger chunks (and some smaller ones too, trying to enhance readability), but when my pod is being parsed, those heredocs get parsed in too.

I've tried including my pod at the top of the script, at the bottom, and either way it still parses the bits that are supposed to be printing.

Any ideas, recommendations, etc?

~Brian

Replies are listed 'Best First'.
Re: Problems with pod parsing
by runrig (Abbot) on Jul 25, 2002 at 22:13 UTC
    All I can think of at the moment is to prefix all of the lines of your heredoc-pod with some character ("#" e.g.), then strip it before you print it...perhaps like this:
    print STDOUT do {(my $tmp = <<EOT) =~ s/^#//mg; $tmp }; #this is #a test EOT