Craig Berry wrote in response to Michael Schwern:
> At 12:56 AM -0500 3/27/02, Michael G Schwern wrote:
> >Except for the file path concatination parts. There's *got* to be
> >some simple VMS equivalent of File::Spec->catfile we can use instead
> >of all these one-liners. What is it?
>
> If there is I can't think of it. You'd have to strip the trailing ']'
> (which might also be a '>'), append the additional directory pieces,
> add back the trailing ']', and then append the filename.
One might use the overloaed "-" and "+" operators on strings, along
with f$parse() a bit like so:
NOECHO = @
PERL_ARCHLIB = perl_root:[lib.VMS_AXP.5_7_3]
FULLEXT = [.ExtUtils.MakeMaker]
INSTALLARCHLIB = perl_root:[lib.VMS_AXP.5_7_3]
INST_LIB = [.blib.lib]
INSTALLPRIVLIB = perl_root:[lib]
INST_ARCHLIB = [.blib.arch]
INST_BIN = [.blib.bin]
INSTALLBIN = perl_root:[000000]
all :
$(NOECHO) OPEN/WRITE TMP .MM_tmp
$(NOECHO) WRITE TMP "read " +
f$parse((("$(PERL_ARCHLIB)"-"]")+".")+"auto"+("$(FULLEXT)"-"[")+".packlist",,,,"SYNTAX_ONLY")
$(NOECHO) WRITE TMP "write " +
f$parse((("$(INSTALLARCHLIB)"-"]")+".")+"auto"+("$(FULLEXT)"-"[")+".packlist",,,,"SYNTAX_ONLY")
$(NOECHO) WRITE TMP "$(INST_LIB) $(INSTALLPRIVLIB)"
$(NOECHO) WRITE TMP "$(INST_ARCHLIB) $(INSTALLARCHLIB)"
$(NOECHO) WRITE TMP "$(INST_BIN) $(INSTALLBIN)"
$(NOECHO) CLOSE TMP
TYPE .MM_tmp
$(NOECHO) Delete/NoLog/NoConfirm .MM_tmp;
Which runs like so:
$ mms
TYPE .MM_tmp
read PERL_ROOT:[LIB.VMS_AXP.5_7_3.AUTO.EXTUTILS.MAKEMAKER].PACKLIST;
write PERL_ROOT:[LIB.VMS_AXP.5_7_3.AUTO.EXTUTILS.MAKEMAKER].PACKLIST;
[.blib.lib] perl_root:[lib]
[.blib.arch] perl_root:[lib.VMS_AXP.5_7_3]
[.blib.bin] perl_root:[000000]
Unfortunately I do not know if that provides a correct .MM_tmp file
for ExtUtils::Install, hence it may still be wrong. Do note in the
above that I changed OPEN/APPEND to OPEN/WRITE since for my test
purposes the .MM_tmp file had not yet existed.
Note too that it constrains a bit further that which can be specified
for config items like $Config{installprivlib} et alia (the catfile()
is much smarter than f$parse()).
Peter Prymmer