Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Embedded POD

by BoredByPolitics (Scribe)
on Jan 11, 2001 at 18:35 UTC ( #51121=perlquestion: print w/replies, xml ) Need Help??

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

I'm trying to embed some pod documentation into a script I am writing, however, I find that once it's embeded the pod utilities (perldoc, pod2man, pod2html) won't display it.

Perl runs the script OK though. If I put the pod into a file on it's own, then it displays fine.

I hope someone can help me with this as it's driving me 'round the bend!

Here's the pod (there is a blank line before the first =directive, and after the last).

=head1 NAME Client_A-Gateway - Perl5 program to act as a gateway between the AS/40 +0 system at Client_A and the Client_B database. =head1 SYNOPSIS B<Client_A-incoming> [ B<-config_file>|B<-cf> I<path> ] [ B<-ftp_root>|B<-fr> I<path> ] [ B<-work_root>|B<-wr> I<path> ] [ B<-clientb_root>|B<-sr> I<path> ] [ B<-incoming_dir>|B<-id> I<path> ] [ B<-incoming_archive>|B<-ia> I<path> ] [ B<-outgoing_dir>|B<-od> I<path> ] [ B<-outgoing_archive>|B<-oa> I<path> ] [ B<-shop_number>|B<-sn> I<number> ] [ B<-logging> ] [ B<-nologging> ] [ B<-log_file>|B<-lf> I<path> ] [ B<-archive> ] [ B<-noarchive> ] [ B<-in_keep_days>|B<-ikd> I<days> ] [ B<-out_keep_days>|B<-okd> I<days> ] B<Client_A-outgoing> [ options as above ] B<Client_A-archive> [ options as above ] =head1 OVERVIEW The Client_A-gateway program processes incoming and outgoing data file +s from/to the AS/400 system at Client_A and Client_B. Client_A had already developed an interface to exchange data with thei +r Store systems, so are using the same interface (albeit with different data) to talk to Client_B. This + program emulates the behaviour expected by the AS/400 system at the Store. It can be invoked in one of 3 ways, each method involving the use of a + symbolic link to the actual program. =over 4 =item Client_A-incoming Processes incoming data files, checking that the batch received has no +t already been received before, and that the accompanying control record matches the batch. The proce +ss I<will> process a batch it has seen before, but only if it has more records than the original (an +d then it only processes the new records). On completion a confirmation record is written to the i +ncoming ftp directory for the AS/400 to pickup. =item Client_A-outgoing Picks up data waiting to go to Client_A from Client_B, packages it in +a format expected by the AS/400, puts it into the outgoing ftp directory, and then updates the control +file in the outgoing ftp directory. The control file is used by the AS/400 to find out what batches are av +ailable. It is trimmed by the Client_A-archive invocation to hold no more than 7 days worth of contr +ol records. =item Client_A-archive If archiving is turned on, the Client_A-incoming and Client_A-outgoing + processes will put a copy of the data file into the relevant archive directory. These archives are then removed +by Client_A-archive once they become too old. This process also trims the outgoing ftp directory of outgoi +ng data batches which are more than 7 days old, and updates the outgoing control file. =back =cut

I've changed the client names, but apart from that it's as it appears.

Many thanks if you manage to spot whatever the mistake is that I've made.

Oh, BTW, I'm using v5.005 of Perl, running on linux.


Replies are listed 'Best First'.
Re: Embedded POD
by BoredByPolitics (Scribe) on Jan 11, 2001 at 19:12 UTC

    OK - Rule Number 1 - when something bizaire happens with text processing tools, always, always, always check that it's not something to do with the end of line character(s)!

    Many thanks for the help I received in the CB, but it turned out to be the \r\n line endings which was causing the problem. Now, perhaps if I hadn't just switched from using vi to emacs, I might have noticed that!


      Use vi! It is your path to salvation!!!! :)

      Mutters "There, if that doesn't start a flame war nothing willl BWaaaaHAHAHA!!"</html>

        Actually, I prefer Xema... Oh, why bother?


        "Perl makes the fun jobs fun
        and the boring jobs bearable" - me

      Even though I generally use vi, I recently discovered a use for pico.

      If you open a DOS encoded file in pico and the quit, you will be prompted to save, and if you do, pico will convert the file.

      I can quickly make the conversion with vi; or even write a perl oneliner to do the conversion, but the pico trick uses very few keystrokes, so if I'm not doing anything else to the file or in vi already, I pull pico out of my pocket and use it (hopefully noone is watching).

      TGI says moo

        A closet picophile? Eughh! ;)

Re: Embedded POD
by clintp (Curate) on Jan 11, 2001 at 19:14 UTC
    I've seen this on a couple of occasions: is the file in DOS format? When you pull it up in VIM does the information line say dos?

    This causes the POD utilities no end of grief, but the perl interpreter has no problems with it whatsoever.

      Unless the POD utilities are using binmode, how would they even know about the \r's when used under a Microsoft operating system?

              - tye (but my friends call me "Tye")

      Thanks for the suggestion clintp - I discovered that was indeed the case when I compared the original file against a cut and paste created version with hexdump.

      I guess it got encoded wrongly when I emailed it as an attachment from home to work... you live and learn eh :-)


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://51121]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (1)
As of 2022-01-25 04:38 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (65 votes). Check out past polls.