Stickybit:
When the documentation of a module doesn't give you quite enough detail, I find it helpful to go to the tests (./t/) directory for the module, and then grep the files to find which tests exercise the function of interest. Then you can see how to call the function. One advantage of this method is that authors try to make the tests as small as possible, so it won't be cluttered up with a bunch of extraneous things you don't need.
I don't have PDF::Builder on my machine, so I just chose a module at random (Ref::Util) from my cpan folder and scanned through the test directory for the test files that use the "is_plain_hashref(" function:
$ grep -r "is_plain_hashref(" .cpan/build/Ref-Util-0.204-0/t/*.t
.cpan/build/Ref-Util-0.204-0/t/all-permutations.t: is_p
+lain_hashref($value),
.cpan/build/Ref-Util-0.204-0/t/all-permutations.t: "is_
+plain_hashref($plain_type) is true",
.cpan/build/Ref-Util-0.204-0/t/all-permutations.t: !is_
+plain_hashref($value),
.cpan/build/Ref-Util-0.204-0/t/all-permutations.t: "is_
+plain_hashref($plain_type) is false",
.cpan/build/Ref-Util-0.204-0/t/all-permutations.t: !is_plai
+n_hashref($value),
.cpan/build/Ref-Util-0.204-0/t/all-permutations.t: "is_plai
+n_hashref($blessed_type) is false",
.cpan/build/Ref-Util-0.204-0/t/functions.t: is_plain_hashre
+f => is_plain_hashref($value),
.cpan/build/Ref-Util-0.204-0/t/magic-readonly.t:ok( is_plain_hashref($
+rh2), 'They are not plain!' );
From here, you can simply look at the test files and see how they do it.
Note: for poorly-tested modules, you may not find anything useful. But in that case, how interested are you in using the module? :^P
...roboticus
When your only tool is a hammer, all problems look like your thumb.
-
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 How to display code and escape characters
are good places to start.