Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

comment on

( [id://3333] : superdoc . print w/replies, xml ) Need Help??


I would also do so...

If you were using OO then calling B->foo() would be the best method, but on your example you're not using OO only funcion call, and when calling it with B->foo(), you must know that the first argument in @_ is the package name 'B'.

So go for B::foo() or take a look at the Exporter module.

Also is good to read the manuals about perlref, perlboot.

There was also a module, think it was by Brian D Foy, something to make alias to the package names inside your package scope...


fmerges at

In reply to Re^2: perl deferring die to calling method by fmerges
in thread perl deferring die to calling method by arcnon

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 How to display code and escape characters are good places to start.