[oak perl] beginning perl question

Belden Lyman blyman at iii.com
Tue Dec 21 13:24:28 CST 2004


Howdy!

Your perl scripts might need a special extension for Windows to
recognize that they are perl scripts. ActivePerl installs registry 
entries so files with .pl extensions are associated with the Perl 
interpreter. PerlIndigo may have done the same thing.

Try giving your 'hello' script one of those extensions and try
running as "hello". (If that doesn't work, then consider switching
to ActivePerl http://activestate.com/Products/ActivePerl/ )

The #! ("shebang") line inspires lots of questions; see, for example,
http://perlmonks.thepen.com/414315.html with corresponding answer at
http://perlmonks.thepen.com/414376.html .

See also http://tinyurl.com/5totl which talks about the #! line
wtr your registry.

hth
Belden

On Tue, 2004-12-21 at 11:08, Sandy Santra wrote:
> Hi, folks...  I'm a super newbie with a *very* beginning perl question.
> 
> I'm writing scripts with PFE 1.01 on a Win98 machine using PerlIndigo to 
> execute them.  My perl program (I think version 5.6.1) is located in the 
> "c:\pearindigo\bin" directory and I put a PATH statement in my autoexec.bat 
> so that typing "perl" at a command line would allow Windows to find the 
> program.  My scripts are stored in a directory of their own and I run them 
> from a DOS window with the prompt set to the same directory.
> 
> What I'm confused about is (1) how to run the scripts, and (2) what goes in 
> the first line of the script.
> 
> For example, if I type "perl hello" from the command line, the "hello" 
> script executes.  Great.
> 
> Now the first line of said script is "#!perl".  If I *remove* said first 
> line ("#!perl") and type "perl hello" again, the script *still* 
> executes.  Why?  How can it work without that first line identifier?
> 
> If I type just "hello" from the command line, I get "bad command or file 
> name," whether I have that first line or not.  (Is it possible to get 
> *that* to work?  How?)
> 
> See, it's nice to know that I can omit that first line from my scripts (and 
> I would love to know why), but what I'd really like is to be able to 
> execute the script by just typing its name at the DOS window prompt without 
> "perl" in front of it.
> 
> Sorry for such boneheaded questions.  Thanks in advance.
> 
> --Sandy Santra
> 
> _______________________________________________
> Oakland mailing list
> Oakland at mail.pm.org
> http://mail.pm.org/mailman/listinfo/oakland



More information about the Oakland mailing list