I maintain PDF::Burst and PDF::OCR2. This concerns PDF::Burst, and setting class variables.

I had some issues using PDF::OCR2 with certain pdf documents. Some I had bad xref tables.. For example. I recently found that some of the documents were failing but it was because PDF::Burst was failing. The simple alternative was to tell PDF::Burst to use another of the three methods (for bursting a pdf into many pages).

My default class variable is set to PDF::Burst::BURST_METHOD = 'CAM_PDF', this can be overriden byt setting it to something else or calling the burst 'methods' directly.

The test suite for PDF::Burst tries out the various 'methods' for bursting a pdf.

I would like to record a default burst method in the class, variably from system to system. That is, for some system (box), the class variable will be x, and for some y. (Keep in mind this can be overriden at any moment by API directly, it just sets a default- instead of a default hard coded, it sets a default varying by system.)

I have these options I can think of;

  1. When PDF::Burst compiles, it seeks out a /etc/pdfburst.conf for which default value to set for the class variable.
  2. When PDF::Burst compiles, it seeks out a ~/.pdfburstrc for which default value to set for the class variable.
  3. When Makefile.PL is run, it changes the hard coded variable in lib/PDF/Burst.pm (this would mean from system to system, the module will have varying md5sums, (is that a potential problem? I can imagine how it would be, out of scope here.))

    This is the tickleiest option for me. How would I even begin to do this? I mean, yeah. I know how.. but.. it seems brute force to simply search and replace code in a .pm

  4. Don't do this at all. Leave changing this PDF::Burst class variable for other packages/cli who use the class (such as PDF::OCR2). I'm open to the idea that this is just overkill.

In reply to Setting class variable default value during Makefile.PL ? by leocharre

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.