Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I wouldn't call it easyer but at the first detection of a pod directive I would set the flag an bail out of the loop instead of searching the rest of the file. It is also posible that a file will not contain '=pod' but still have pod in it. I would use something like this:
my $file = '/tmp/file'; open(IN, "<$file") or die "$0: cannot read file '$file': $!"; my $pod = 0; while (<IN>) { $pod = 1, last if /^=\w/ } #/^=(pod|head\d|over|item|back|cut)/ might be more accurate #=begin, =end, and =for are ommited because they would #usualy be ignored by pod2* close(IN); pod2html($file) if $pod;

In reply to Re: detecting pod in files? by Ven'Tatsu
in thread detecting pod in files? by edwyr

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2022-10-02 18:58 GMT
Find Nodes?
    Voting Booth?
    My preferred way to holiday/vacation is:

    Results (12 votes). Check out past polls.