> From: Wayne Berke <berke@panix.com>
>
> In message <9510201143.aa03091@relay-3.mail.demon.net>, Tim Bunce writes:
> >
> > `pwd` is such a common idiom in old code that I think it should be
> > supported. Either by supplying a pwd command or catching this
> > particular case inside NT perl.
> >
> > Anyway, the _correct_ answer to the problem is not to make an NT
> > specific change in the application (e.g., 'cd' without any arguments)
> > but to make a change that increases the portability of the application
> > e.g., add 'use Cwd;' and change `pwd` to getcwd().
> >
> > It is important that Cwd.pm is patched to work correctly on all
> > supported perl platforms, including NT.
>
> Just out of curiosity, why should a perl user have to 'use' a custom
> module just to print out the working directory? By contrast, 'chdir'
> is a perl builtin. I suspect this seeming anomoly is a reflection of the
> fact that Unix has a system call for chdir but doesn't need one for getwd.
> However, this doesn't seem relevant to whether or not getwd should be a perl
> builtin.
Personally, I agree that getwd should be a builtin. However it is vital
that if it becomes a builtin it does so for _all_ platforms.
Given that `pwd` figures highly when porting to new non-unix platforms
Larry may consider it if someone submitted a clean patch. I've CC'd
this to perl5-porters in case someone has the time to do it.
(Ilya, what did you do for OS/2?)
Changing scripts to use an NT specific command should never be recommended.
Supplying a wide range of UNIX (or POSIX.2) commands is obviously not
practical but supplying a pwd.bat for NT or catching `pwd` internally
in NTperl would be pragmatic since `pwd` is such a commonly used idiom
in old code.
Meanwhile the Cwd module is the way to go for new code or code that
can be edited.
Tim.
>
> In message <9510201143.aa03091@relay-3.mail.demon.net>, Tim Bunce writes:
> >
> > `pwd` is such a common idiom in old code that I think it should be
> > supported. Either by supplying a pwd command or catching this
> > particular case inside NT perl.
> >
> > Anyway, the _correct_ answer to the problem is not to make an NT
> > specific change in the application (e.g., 'cd' without any arguments)
> > but to make a change that increases the portability of the application
> > e.g., add 'use Cwd;' and change `pwd` to getcwd().
> >
> > It is important that Cwd.pm is patched to work correctly on all
> > supported perl platforms, including NT.
>
> Just out of curiosity, why should a perl user have to 'use' a custom
> module just to print out the working directory? By contrast, 'chdir'
> is a perl builtin. I suspect this seeming anomoly is a reflection of the
> fact that Unix has a system call for chdir but doesn't need one for getwd.
> However, this doesn't seem relevant to whether or not getwd should be a perl
> builtin.
Personally, I agree that getwd should be a builtin. However it is vital
that if it becomes a builtin it does so for _all_ platforms.
Given that `pwd` figures highly when porting to new non-unix platforms
Larry may consider it if someone submitted a clean patch. I've CC'd
this to perl5-porters in case someone has the time to do it.
(Ilya, what did you do for OS/2?)
Changing scripts to use an NT specific command should never be recommended.
Supplying a wide range of UNIX (or POSIX.2) commands is obviously not
practical but supplying a pwd.bat for NT or catching `pwd` internally
in NTperl would be pragmatic since `pwd` is such a commonly used idiom
in old code.
Meanwhile the Cwd module is the way to go for new code or code that
can be edited.
Tim.