Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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?

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://644168]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2018-02-20 04:10 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (267 votes). Check out past polls.