Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Based on what you've posed here, you definitely don't need to use the eval with require BAREWORD;, require "/path/to/"; would be much easier in your case. Also, note that despite its several caveats, a glob might be easier than opendir in this case. Here's an example, where $stylespath is an absolute pathname (see do for the rules on when @INC will be searched and when it won't):

use File::Glob 'bsd_glob'; my $style = $ARGV[1]; die "bad style" unless $style=~/\A\w+\z/; require $_ for bsd_glob("$stylespath/$style/*.pm");
the subroutines are still undefined: Undefined subroutine &modes::three::flex I'm not sure why this is.

What package statement (if any) does english/ start with? If it's e.g. package eight;, then a sub flex in that file declares a subroutine whose full name is &eight::flex.

Note that the AM post does not name one caveat of UNIVERSAL's can method, which is that it also searches the package's ancestry via @ISA for that method - if you don't set @ISA in your packages, it's fine, but if you do, then you need to be aware of this. If you want to avoid that, then this is IMO one of those rare cases where symbolic refs can help: my $package = 'eight'; my $subref = do { no strict 'refs'; \&{$package.'::flex'} };.

Update: That you've traced it down to this issue also helps explain what you described in your root node, that you see a difference between 5.18 and 5.26: Removal of the current directory (".") from @INC may explain your issue. But my suggestions above still stand!

In reply to Re^5: Parsing Problems (updated) by haukex
in thread Parsing Problems by ftherese

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 avoiding work at the Monastery: (5)
As of 2022-07-07 10:58 GMT
Find Nodes?
    Voting Booth?

    No recent polls found