Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Pod::Usage prepends "Usage:" to my synopses -- why?

by jbullock35 (Hermit)
on Oct 11, 2007 at 08:44 UTC ( #644168=perlquestion: print w/ replies, xml ) Need Help??
jbullock35 has asked for the wisdom of the Perl Monks concerning the following question:

I can't get Pod::Usage to do quite what I want. Consider:
use strict; use Pod::Usage; pod2usage(); =head1 SYNOPSIS Some sample text =cut
I want this should print Some sample text to STDERR, and I think that is what it should do. But instead, it prints
Usage: Some sample text
Why is Pod::Usage prepending "Usage: " and a blank line when it prints my synopsis? Or does the problem lie with pod (or my ignorance of pod)? Either way, how can I stop it?

Comment on Pod::Usage prepends "Usage:" to my synopses -- why?
Select or Download Code
Re: Pod::Usage prepends "Usage:" to my synopses -- why?
by shoness (Friar) on Oct 11, 2007 at 14:42 UTC
    It looks like you're stuck with "Usage:". The source code for Pod::Usage seems to change your "SYNOPSIS" to "USAGE" then lowercase it and append the colon:

    sub preprocess_paragraph { my $self = shift; local($_) = shift; ## See if this is a heading and we arent printing the entire manpa +ge. if (($self->{VERBOSE} < 2) && /^=head/o) { ## Change the title of the SYNOPSIS section to USAGE s/^=head1\s+SYNOPSIS\s*$/=head1 USAGE/o; ## Try to do some lowercasing instead of all-caps in headings s{([A-Z])([A-Z]+)}{((length($2) > 2) ? $1 : lc($1)) . lc($2)}g +e; ## Use a colon to end all headings s/\s*$/:/o unless (/:\s*$/o); } return $self->SUPER::preprocess_paragraph($_); }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://644168]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2014-12-27 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls