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.

  • 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

  • This is a great idea and I am investigating the original request to support "use module" searching for Job, Library, Lsyslib via @INC. However, I have looked into the follow up comment about having to reopen the division to reload the module. Unfortunately, the perl interpreter has been embedded into the composition engine and I cannot find any way to tell the interpreter to invalidate modules. For that matter, I dont know what module to reload since they can be referenced via a "use" anywhere (even from another module). And I certainly do not want to reload all modules every time a "compose xxx" is initiated in the xyview.

    As an aside, while unstated, it is  implied that Pathfinder would need access to the ".pm" files for create, delete, copy, edit, etc. This is also being looked at.

  • Having tied to do my first production job in CSS XML this is not only a good idea but essential!

  • And thumbs up for the avoidance of a store / exit / re-open  too!

  • Aligning the XyPerl module lookup so it's in step with other XPP style elements sounds like a great, and logical, step forward.