Re: Comments on LWP from a Mac user
Martijn Koster (mak@victor.nexor.co.uk)
Mon, 07 Aug 1995 17:12:01 BST
A quick message, while machines around here changing operating systems,
and consoles are blowing their power supplies...
In message <199508070703.JAA00931@bergen.oslonett.no>, Gisle Aas writes:
> > I don't know
> > whether you intend LWP to be easily portable to anything other that
> > machines running Unix. If not, simply ignore this.
>
> I would not mind having a portable library if somebody contributes solutions
> and testing on non-Unix platforms.
It'd be nice to at least make porting jobs easier.
> > I notice the some of the same sorts of problems in LWP. For example, in
> > LWP::Protocols::http, there's $endl = "\r\n";.
>
> These ones should be easy to fix.
Yes.
> > In LWP::Protocols::file,
> > there's an assumption that you can immediately take the $path part of the
> > file: URL and do a -e, -r, etc. on it. What's needed here (or in fact, in
>
> > URI::URL if you insist on using fastcwd(); the path
> > "Macintosh HD:MacPerl5_scripts:lwp-0.20:" wouldn't work too well in a URL)>
>
> > is a way of converting names from the local to the network file system,
> > say localtonet() and nettolocal(). These would, of course, be no-ops
> > on Unix machines and would need to be defined for each individual
> > architecture.
>
> Does fastcwd() return a colon-separated path in MacPerl?
>
> We could set it up such that URI::URL::file->fullpath returns a path that is
> suitable for the local OS type, so that we can assume that we can try to open
>
> the file directly.
>
> How would you test if you are running under MacPerl at runtime? Something
> like:
>
> use Config;
> if ($Config{'osname'} eq 'Mac') ...
>
> or just if ('/r' eq '/012') ...???
Whoa, the "\r\n" phenomenon doesn't imply anything about path name
separators.
I'd really rather not start ifdef'ing OS's in LWP modules; File::Basename
etc is bad enough, IMHO.
I think Paul's suggestion of a localtonet-type thing is good.
Maybe we need a File::PathSeparator, with converting functions.
> > The self-tests I've looked at are mostly hopeless (heck, /vmunix
> > doesn't exist on a Linux box, let alone a Macintosh), but that's
> > something you get used to. To paraphrase Matthias Neeracher, MacPerl's
> > author, Perl tests are largely a test of whether you're running Unix.
Actually, the self tests are only half there even on UNIX; you need to set
up scripts, change hostnames, etc. That can do with some improvement;
I'd like to see all tests reduced to a CGI directory, test scripts, and
a config file. I just never got round to it.
-- Martijn
__________
Internet: m.koster@nexor.co.uk
X-400: C=GB; A= ; P=Nexor; O=Nexor; S=koster; I=M
WWW: http://web.nexor.co.uk/mak/mak.html