H
Henry Law
I have a library of modules for a Perl application which has code
running on a Windows client and on a Linux server. Code writing and
documenting is done on the client. The number of subroutines has
expanded considerably, and I'm still developing, so I'm trying to
develop a simple utility which will document which objects are exported
from each module, and its version.
I've looked on CPAN without finding anything simple that does what I
want (but I'm not convinced I searched with the right strings, so
pointers would be welcomed), so I knocked up a simple application. It
_almost_ works and I would like it if someone can help me make the last
jump.
Here's the core of my code, using a standard module so you can run it if
you need to:
#! /usr/bin/perl
use strict; use warnings;
require File::Copy;
foreach my $exported_sub (@File::Copy::EXPORT_OK) {
print "$exported_sub\n";
}
For this particular module it works fine:
But if I run it on my Windows _development_ _client_ against one of the
_server_ modules the "require" statement croaks because the server has a
different set of Perl modules installed. I get "Can't locate xxx in
@INC (@INC contains ..." messages.
So can I get access to the @EXPORT variables from a module without
causing the "require" statement to fail because it can't load dependent
modules? Or can I suppress the "Can't locate" messages safely just for
the tool? Or is there some other way of extracting the names of the
exported objects easily?
I realise that I could work around the problem either by running the
documentation tool on the server for the server modules, or by
installing the server modules on the client where I'm running the
documentation tool. The former is inconvenient; the latter ugly and
maybe not even possible.
running on a Windows client and on a Linux server. Code writing and
documenting is done on the client. The number of subroutines has
expanded considerably, and I'm still developing, so I'm trying to
develop a simple utility which will document which objects are exported
from each module, and its version.
I've looked on CPAN without finding anything simple that does what I
want (but I'm not convinced I searched with the right strings, so
pointers would be welcomed), so I knocked up a simple application. It
_almost_ works and I would like it if someone can help me make the last
jump.
Here's the core of my code, using a standard module so you can run it if
you need to:
#! /usr/bin/perl
use strict; use warnings;
require File::Copy;
foreach my $exported_sub (@File::Copy::EXPORT_OK) {
print "$exported_sub\n";
}
For this particular module it works fine:
F:\>tryit.pl
cp
mv
But if I run it on my Windows _development_ _client_ against one of the
_server_ modules the "require" statement croaks because the server has a
different set of Perl modules installed. I get "Can't locate xxx in
@INC (@INC contains ..." messages.
So can I get access to the @EXPORT variables from a module without
causing the "require" statement to fail because it can't load dependent
modules? Or can I suppress the "Can't locate" messages safely just for
the tool? Or is there some other way of extracting the names of the
exported objects easily?
I realise that I could work around the problem either by running the
documentation tool on the server for the server modules, or by
installing the server modules on the client where I'm running the
documentation tool. The former is inconvenient; the latter ugly and
maybe not even possible.