Just a couple of things to add to what went before.......

The best way to check your code when first written is to run with the -w
switch and/or 'use strict'.

perl -w myscript.pl

Activestate's builds of Perl will add file associations for .pl and modify
the search path if this is selected during the install, but some systems may
require a reboot before this goes into effect.

Andy



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, January 24, 2001 8:39 AM
To: [EMAIL PROTECTED]
Cc: Jon Bjornstad; James D Carella;
[EMAIL PROTECTED]
Subject: Re: Please Help!



Sorry for the typo "low-code" should be "low cost"

Oops




                    [EMAIL PROTECTED]
                    Sent by:                                     To:     Jon
Bjornstad <[EMAIL PROTECTED]>
                    [EMAIL PROTECTED]        cc:
James D Carella <[EMAIL PROTECTED]>,
                    eState.com
[EMAIL PROTECTED]
                                                                 Subject:
Re: Please Help!

                    01/24/01 09:33 AM





A couple of other simple items.

1 - If you are going to do programming in perl, I suggest you use something
other than notepad as your editor.  I use UltraEdit (around $30 US) and it
makes my life much simpler and it is much more robust than Notepad.  There
are probably other low-code editors out there as well
2-Put your perl script in a bat file with a "pause" statement (or use
UltraEdit's Advanced|Dos Command option).
     i.e.
     mybat.bat
          perl hello,.pl
          pause
Good Luck. Perl is a really cool language for doing stuff and this board is
a great place for answers and suggestions

Scott




                    Jon Bjornstad <[EMAIL PROTECTED]>

                    Sent by:                                     To:
James D Carella <[EMAIL PROTECTED]>
                    [EMAIL PROTECTED]        cc:
[EMAIL PROTECTED]
                    eState.com                                   Subject:
Re: Please Help!


                    01/24/01 03:08 AM





James D Carella wrote:
>
> Hello,
>          Can someone help me please?  I am definitely starting out in the
> programming thing and I am trying and learning Perl.  I have downloaded
> the newest version and to my knowledge it has been installed correctly.
> What I need help with is the DOS command line part of a simple script.  I
> will write the script in Notepad and then save it correctly.  When I go
> to open it in the DOS command prompt it wont work and it just keeps on
> saying something like "Bad command or file name".  I can't seem to just
> run it in the DOS command prompt and when I find the file in Microsoft
> Explorer and double-click it it seems to run by opening a DOS window and
> flashing quickly the script that I wrote in Notepad.  So I have said all
> that to say this; that is it supposed to flash that DOS window with the
> script in it?  And also please tell me what to do with running it from
> the DOS command line.
> ...

I hear your confusion, James, and this is
an issue that I have taken a particular interest in.

Apparently the latest version of the installation
from ActiveState still does not modify the PATH variable
for invoking perl from a DOS prompt.    Or perhaps
you are not saying:

> perl hello.pl

at the command prompt but just:

> hello.pl
????

The flashing DOS window means that you either have a
syntax error in your program (but how can you know what it is
if it doesn't stay around long enough to read it! :)
OR you do not request any input from the user (as
the simple and customary first program - print "hello world\n"; - would
not.)

See this web site:

http://www.icogitate.com/~perl

This is a web site I set up for a class in perl that
I taught at a local junior college.   There are two links
there near the top that explain how to set perl up on your computer
and do perl development on Win32 platforms.    They
address that flashing DOS window conundrum that you and
many others have unfortunately experienced as their first impression
of perl on Windows.

I would suggest to Activestate that there is probably a better
way to go that would avoid this confusion for future newbies.
How about a default open action in the registry for .pl programs
as I describe in the link above.   And if you want to put
the program into production change it to a .px file for
immediate execution by perl.exe????

Another way to see the syntax errors is this:

CHECK {         print "after compilation..."; <STDIN> }

this will pause the DOS window from disappearing right after
the compilation phase before execution.    You could
comment and uncommment this line depending on if you
suspect you have syntax errors that need correcting.

Hope this helps,
Jon
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users




_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users




_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to