Mail Archives: cygwin/2000/03/02/22:06:17
------=_NextPart_000_0063_01BF8493.60429B20
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I am having problems running Perl on my Windows 98 machine using the =
Cygwin B-32 BASH shell. While I can run Perl from the command line, I =
cannot yet get "stand-alone" Perl programs to run, i.e., programs where =
Perl runs not because the command "perl -e" is evoked in the first =
position on the command line but rather because the ".pl" file itself =
has information concerning the location of the Perl interpreter on the =
computer.
Installation: Perl version 5.005_03 built for =
MSWin32-x86-objec. Binary build 522 from ActiveState Tool Corp.
BASH shell downloaded from Cygwin, version B20.=20
Objectives: I have multiple objectives in studying Perl.=20
(1) Write CGI scripts for Web site am designing. Am working my way thru =
E. Castro's "Perl and CGI for the World Wide Web" (Peachpit Press). Have =
directory on a friend's server which I can use for practice purposes; =
server runs Apache web server with BASH-2.02 shell. Have learned enough =
Unix to Telnet to that server, get around it, change permissions, etc. =
So far so good.=20
(2) On my job (hospital) I face problem of editing text files (client =
medication histories) so as to make them conform to a certain database =
format. Friend with Perl expertise says this would be an ideal job for =
Perl. However, job would have to be done on PC rather than over =
network/Net to a file server.
Question arises: Should I learn Perl thru an MS-DOS command line for =
this application, while learning Perl thru BASH command line for regular =
Web application? My thinking: It would probably be simpler to learn =
one command line (BASH) first. However, that means that I have to get =
the BASH shell to work on a Windows 9x machine -- and that I have to get =
Perl to work properly on that shell.
Hence the Cygwin and ActiveState downloads. But my Perl practice =
programs only seem to work when "perl -e" is called on the command line. =
I can't get programs which start with the shebang line to run. In =
addition, the command "which perl" doesn't work. It generates the =
message: "bash: which: command not found".
Research: My research into this problem has generated =
contradictory information. The ActivePerl FAQ =
(<http://www.activestate.com/ActivePerl/docs/perl-win32/perlwin32faq4.htm=
l>) states: "...Win32 platforms don't provide the shebang syntax, or =
anything like it. The FAQ suggests (a) calling the perl interpreter =
directly (as in "perl myscript.pl"), (b) installing an Apache webserver =
on a Win32 system (which does accept the shebang syntax) or (c) =
converting Perl script into a batch file using the "pl2bat" utility =
distributed with Perl for Win32. (b) and (c) seem overly complex, =
especially to a beginner like me.
The O'Reilly book Learning Perl on Win32 Systems, however, says (p.9 =
fn.), "...there are Win32 ports of UNIX shells (e.g., tcsh, ksh, and =
bash) that do understand shebang lines. If you're using one of these =
shells, you can use shebang lines by specifying the path to your Perl =
interpreter."
Vincent Lowe's Perl Programmer's Interactive Workbook (Prentice Hall =
PTR) states that "For MS-DOS operation, you'll need to make the program =
look like a batch file and have it start Perl for you." (p.23) However, =
it's not clear whether this applies to any DOS-based system (including =
my Windows 98 system) or just to the MS-DOS shell and command line. If =
the former, then on a Windows computer I'll have to learn Perl via the =
DOS command line; BASH would be useless. If the latter, I should be =
able to learn Perl via the BASH command line, whether the installation =
is a Windows computer or Unix.
Can anybody help?
------=_NextPart_000_0063_01BF8493.60429B20
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2722.2800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT size=3D2><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'">I =
am having=20
problems running Perl on my Windows 98 machine using the Cygwin B-32 =
BASH shell.=20
While I can run Perl from the command line, I cannot yet get =
"stand-alone" Perl=20
programs to run, i.e., programs where Perl runs not because the command =
"perl=20
-e" is evoked in the first position on the command line but rather =
because the=20
".pl" file itself has information concerning the location of the Perl=20
interpreter on the computer.<?xml:namespace prefix =3D o ns =3D=20
"urn:schemas-microsoft-com:office:office" =
/><o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT =
size=3D2><U><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'">Installation</SPAN></U><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'">: =
<SPAN=20
style=3D"mso-tab-count: =
1"> =20
</SPAN>Perl version 5.005_03 built for MSWin32-x86-objec.<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>Binary build 522 from =
ActiveState Tool=20
Corp.<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT size=3D2><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'"><SPAN=20
style=3D"mso-tab-count: =
1"> =20
</SPAN><SPAN=20
style=3D"mso-tab-count: =
1"> =20
</SPAN>BASH shell downloaded from Cygwin, version B20.=20
<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT =
size=3D2><U><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'">Objectives</SPAN></U><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New Roman'">: =
I have=20
multiple objectives in studying Perl. <o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT size=3D2><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'">(1) Write=20
CGI scripts for Web site am designing. Am working my way thru E. =
Castro's "Perl=20
and CGI for the World Wide Web" (Peachpit Press). Have directory on a =
friend's=20
server which I can use for practice purposes; server runs Apache web =
server with=20
BASH-2.02 shell. Have learned enough Unix to Telnet to that server, get =
around=20
it, change permissions, etc. So far so good. =
<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT size=3D2><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'">(2) On my=20
job (hospital) I face problem of editing text files (client medication=20
histories) so as to make them conform to a certain database format.<SPAN =
style=3D"mso-spacerun: yes"> </SPAN>Friend with Perl expertise =
says this=20
would be an ideal job for Perl.<SPAN style=3D"mso-spacerun: yes"> =20
</SPAN>However, job would have to be done on PC rather than over =
network/Net to=20
a file server.<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT size=3D2><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'">Question=20
arises:<SPAN style=3D"mso-spacerun: yes"> </SPAN>Should I learn =
Perl thru an=20
MS-DOS command line for this application, while learning Perl thru BASH =
command=20
line for regular Web application?<SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN>My thinking:<SPAN style=3D"mso-spacerun: yes"> </SPAN>It =
would=20
probably be simpler to learn one command line (BASH) first.<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>However, that means that I =
have to get=20
the BASH shell to work on a Windows 9x machine -- and that I have to get =
Perl to=20
work properly on that shell.<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT size=3D2><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'">Hence the=20
Cygwin and ActiveState downloads.<SPAN style=3D"mso-spacerun: =
yes"> =20
</SPAN>But my Perl practice programs only seem to work when "perl -e" is =
called=20
on the command line.<SPAN style=3D"mso-spacerun: yes"> </SPAN>I =
can't get=20
programs which start with the shebang line to run.<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>In addition, the command =
"which perl"=20
doesn't work.<SPAN style=3D"mso-spacerun: yes"> </SPAN>It =
generates the=20
message:<SPAN style=3D"mso-spacerun: yes"> </SPAN>"bash:<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>which:<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>command not=20
found".<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT =
size=3D2><U><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'">Research</SPAN></U><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'">:<SPAN=20
style=3D"mso-tab-count: =
1"> =20
</SPAN>My research into this problem has generated contradictory=20
information.<SPAN style=3D"mso-spacerun: yes"> </SPAN>The =
ActivePerl FAQ=20
(<U><SPAN=20
style=3D"COLOR: =
blue"><http://www.activestate.com/ActivePerl/docs/perl-win32/perlwin32=
faq4.html></SPAN></U>)=20
states:<SPAN style=3D"mso-spacerun: yes"> </SPAN>"...Win32 =
platforms don't=20
provide the shebang syntax, or anything like it.<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>The FAQ suggests (a) calling =
the perl=20
interpreter directly (as in "perl myscript.pl"), (b) installing an =
Apache=20
webserver on a Win32 system (which does accept the shebang syntax) or =
(c)=20
converting Perl script into a batch file using the "pl2bat" utility =
distributed=20
with Perl for Win32.<SPAN style=3D"mso-spacerun: yes"> </SPAN>(b) =
and (c)=20
seem overly complex, especially to a beginner like=20
me.<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT size=3D2><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'">The O'Reilly=20
book <I style=3D"mso-bidi-font-style: normal">Learning Perl on Win32 =
Systems,=20
</I>however, says (p.9 fn.), "...there are Win32 ports of UNIX shells =
(e.g., <I=20
style=3D"mso-bidi-font-style: normal">tcsh, ksh, </I>and <I=20
style=3D"mso-bidi-font-style: normal">bash</I>) that do understand =
shebang=20
lines.<SPAN style=3D"mso-spacerun: yes"> </SPAN>If you're using =
one of these=20
shells, you can use shebang lines by specifying the path to your Perl=20
interpreter."<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT size=3D2><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'">Vincent=20
Lowe’s <I style=3D"mso-bidi-font-style: normal">Perl =
Programmer’s Interactive=20
Workbook</I> (Prentice Hall PTR) states that “For MS-DOS =
operation, you’ll need=20
to make the program look like a batch file and have it start Perl for =
you.”=20
(p.23)<SPAN style=3D"mso-spacerun: yes"> </SPAN>However, =
it’s not clear=20
whether this applies to any DOS-based <U>system</U> (including my =
Windows 98=20
system) or just to the MS-DOS shell and command line.<SPAN=20
style=3D"mso-spacerun: yes"> </SPAN>If the former, then on a =
Windows=20
computer I’ll have to learn Perl via the DOS command line; BASH =
would be=20
useless.<SPAN style=3D"mso-spacerun: yes"> </SPAN>If the latter, I =
should be=20
able to learn Perl via the BASH command line, whether the installation =
is a=20
Windows computer or Unix.<o:p></o:p></SPAN></FONT></P>
<P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 5pt"><FONT size=3D2><SPAN=20
style=3D"FONT-FAMILY: Arial; mso-bidi-font-family: 'Times New =
Roman'">Can anybody=20
help?<o:p></o:p></SPAN></FONT></P></DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_0063_01BF8493.60429B20--
- Raw text -