Clinton A . Pierce wrote:
> On Wed, Apr 11, 2001 at 01:02:06PM +0100, Simon Myers wrote:
> > Ah. Then I can just do:
> > C:\My Documents\Perl> Hello.pl
> > and it will run it that there Command Prompt window?
>
> Yes. But only if the associations are built correctly and supported.
Some further caveats about Windows' default command processors.
In my experience (and someone correct me if I'm wrong; it's been a while),
the above syntax won't work in Win95 using command.com. (Never tried
Win98.) You must run the perl interpreter directly, e.g.,
C:\My Documents\Perl>perl Hello.pl
On NT4.0 using cmd.exe, you can simply invoke the script by name/extension.
However, if you do so, command-line redirection and piping are broken; you
can't go
C:\My Documents\Perl>Hello.pl >myfile.txt
and expect anything other than a zero-byte output file. Similarly,
C:\My Documents\Perl>Hello.pl |more
sends its output to nullsville. Both will work if you expressly run perl,
rather than the script.
I haven't tried Win2k, so I don't know whether they've improved the command
processor there.