Garrett Goebel wrote:
> Environment variables. I believe both : and ; are illegal for use in
> filenames. I'm not sure what you need, but you should be able to split on
> either. @paths = split /(\:|\;)/, $ENV{'PATH'};
>
> > I also create a makefile that calls "cp" (should be
> > "copy" on Windows).
>
> Instead of cp|copy, you could use Perl's File::copy, or you might go pick
> out a Perl version of cp from the Perl Power Tools Project
> (http://language.perl.com/ppt/).
I would use File::Copy. You may end up needing File::Find, File::Path
and others as well. These modules are on every Perl installation. Resist
the temptation to use native commands. The only native calls I make in
Inline::C are 'make' and 'perl', and I get those values from Config.pm.
NOTE: Eventually you'll need to add UNTAINT support. File::Path (if you
use it) cannot be untainted. You should use Inline::mkpath and
Inline::_rmtree instead.
That reminds me. You have a err_msg routine. That's OK but I think that
code really needs to be in Inline.pm. Since I'll be adding optional
interactive debugging in the future, all ILSM's will be able to yield to
Inline->build_error() when a build fails. I'll keep you posted.
> > What's the best way to detect the running OS and do this kind of
> > distinction? Is there any kind of standard method?
>
> In my Makefile.PL's I put something that is pretty standard:
>
> warn <<'EOT' if $^O eq 'MSWin32';
$^O is probably what you want in most cases. Some known (to me) values
are:
MSWin32
linux
aix
hpux
solaris
freebsd
You can search 'OK' messages at
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/
for 'osname='.
Cheers, Brian
--
perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf
("Just Another %s Hacker",x);}};print JAxH+Perl'