RE: Training Using Windows

[email protected] ("Rubinow, Larry")
Newsgroups perl.trainers
Message-ID <D5AC91A926FBD41196060006298F244C160867@eg-msgmbx-b06.int.westgroup.com>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.