On 7/17/2004 12:25 PM, David Wheeler wrote:
On Jul 16, 2004, at 7:48 PM, Randy W. Sims wrote:
It looks like maybe we could use 'virtual' packages like I mentioned below to solve this:
Erm, that should have been:
YAML:
requires: db_driver: [postgresql] || [mysql] [postgresql]: DBD::Pg: 0 DataTime::Format::Pg: 0 [mysql]: DBD::mysql: 0 DataTime::Format::mysql: 0
Keys in brackets (that is legal YAML isn't it?) are not evaluated until they are encountered in the value part of an expression who's key is not also a macro.
Square brackets denote virtual packages or macros. This should solve all the issues you mention as far as YAML goes. The Build.PL file is much more flexible; we can express these dependencies in many ways. There is not much of an issue there.
Yes, that works for me.
Note that there is an implication for CPAN.pm and CPANPLUS. When a requirement with an OR condition is encountered they will have to either prompt the user for a selection or select the first option as a default. I'm not sure if there are any other compatability problems as I'm not real familiar with their implementation. But the author's should probably be consulted before making a final decision.
Also, if there were a single module that all tools used to check requirements, it could include builtin macros for common "virtual" packages: DBD, DBM, Archiver, Encryption, ...
Randy.