http://www.perlmonks.org?node_id=907576


in reply to Re: Re: It LOOKS right...
in thread It LOOKS right...

I type in 'perl name.plx'

In this case, it doesn't matter what path you put in the shebang/#!/first line, though the options still matter - perl will process them. You can (and probably should) read more in perlrun.

You may know that if you set execute permission on your script file you can run it with './name.plx' if it is in your current working directory or simply 'name.plx' if it is in one of the directories in your path. This can be convenient, but isn't necessary. If you want this to work, then you will have to have the path to your perl program in the first line, or use one of the "tricks" mentioned in perlrun.

I hope you start using "use strict" and "use warnings". You might have a look at perllexwarn to learn more about what they do and how to control them (sometimes you want to do things without the warnings or compilation errors).

If you want to print "Hello world" 20 times, use while instead of if, but TMTOWTDI. I might write your program something like this:

use strict; use warnings; print "Hello World!\n" for (1..20); print "Wait, that's it?\n";