Idea Delivered

This will be available with the XPP 9.4 version release.

xyPerl: fix lookup for shared perl functions (modules), should be 1. current job, 2. style library, 3.syslib, 4. xpp perl folder

The lookup for CSS imported modules (the @import things) is the normal style lookup sequence 1. current job, 2. style library, 3.syslib.
And that allows you to 'share' common CSS settings among similar style bundles in a nice and convenient way.
(which is by the way a big plus when working with CSS compared to working with IF stylesheets).

It would be nice to have xyPerl work in the same way.
In similar styles you probably want to share 'perl functions' in the same way as you do with CSS settings.
Or even have perl functions (e.g. frills processing loops) that can be used by any of the styles you have.
(and yes this could be done by putting your perl module in the xpp perl folder, but that folder is not accessible from the pathfinder interface, so not a convenient place)

'Sharing' common things in a perl environment is done through using perl modules.
Modules are called in into the main xyPer program using a 'use' statement.
Perl will lookup a module based on the paths in the @INC array.
It would be nice if XPP could add the current job, the style library and the Lsyslib to the @INC for us.

Currently we can more or less do this ourselves but we need to hard code the style library name in the main xyPerl as inside composition we do not know what is the style library for a particular job.

Things would work a lot better if XPP can manipulate the @INC for us.

REMARK:
it would also be nice if there would be a possibility to force XPP to reload the perl modules you use in your main xyPerl.
Currently you need to store/exit and reopen the division in order to make this happen.
and that is very uncool while you are developing your shared functions.

Parents
  • I see that this Idea has been implemented in the XPP 9.4 release and gets a mention in the Release Notes and on page 6-19 of the XyMacros manual.

    However, when I try and print out @INC from inside my XyPerl using this:


    foreach (@INC) {
      $X->qa();
      $X->set_text("$_");
    }

    I am not seeing the path to the current JOB, only these paths:

    D:\XPP\xz/perl
    ..
    D:\XPP\sd_liz\Lbills
    D:\XPP\sd_liz\Lsyslib
    D:/XPP/xz/perl/site/lib
    D:/XPP/xz/perl/vendor/lib
    D:/XPP/xz/perl/lib

    The first 4 lines of the above seem to have been added to my @INC by XPP, but I was expecting to see a fully qualified path to my JOB_  folder  

    Or maybe I have missed something?!

    Paul

    Letterpart Ltd

  • Of course, this only applies to the XPP composition engine (and not in general to the use of the XPP-delivered Perl outside of that context).

    in that context CWD (current working directory) is always the DIV folder, so the JOB path lookup was implemented by adding the "shortcut" relative path of ".." to @INC (and not the absolute path).

    It's easy enough in Perl to get the full absolute path for CWD and chop off the DIV part to get the full JOB path, if you really need or want it.

    Jonathan Dagresta

    RWS XPP Engineering

  • That's great - thanks very much for your explanation Jonathan (and sorry for delay in responding).

    Paul

Comment Children
No Data