Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
more useful options
 
PerlMonks  

Problems with pod parsing

by brianarn (Chaplain)
on Jul 25, 2002 at 17:40 UTC ( [id://185356]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

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 18: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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://185356]
Approved by sm3g
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.