Hello ye Monks!

This isn't strictly a perl question, but it's a pod question so be merciful..

I like writing my docs in pod and I write bash scripts from time to time. I want to keep the pod in the same file as the script 'cause bad things happen when they get separated (at least in my hands bad things happen...) I figured I could put my pod after an exit call in bash and I'd be fine, but it didn't work.

Anyway, the real question isn't a bash question it is: does pod have any magic syntax to fit inside of something like the comments of another language. EG, is there a way to write pod like this...

#! /bin/bash echo "stupid bash user! Write perl!" exit #=head1 NAME # #Foo # #=head1 SYNOPSIS # #Eat 100 pounds of bannanas

Or like this

#include stdio.h void main () { printf("all that just to say this? Use perl!\n"); } /* =head1 NAME Foo =head1 SYNOPSIS Eat 100 pounds of bannanas */

...er... okay that works out of the box... but anyway, you get my point...

UPDATE: my original bash problem was just me being stupid. You can put pod after the exit in bash. Duh. However! I'm still curious if pod can operate inside another languages arbitrary line-based comments.

Another Update!: Yes. I suck and I waste your time. I admit it freely and accept any punishment you desire to inflict. Achem...

You can put the pod inside a string that does nothing in nearly any language. EG in bash:

#! /bin/bash echo "Pileofrogs is a jerk!" FOO=<<ENDOFPOD =head1 NAME i_suck =head1 SYNOPSIS To increase your overall suckage, simply introduce Pilofrogs into the +environment =cut ENDOFPOD

In reply to Pod in other languages? by pileofrogs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.