Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
Syntactic Confectionery Delight

Re^2: It LOOKS right...

by ig (Vicar)
on Jun 01, 2011 at 06:39 UTC ( #907576=note: print w/ replies, xml ) Need Help??

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";

Comment on Re^2: It LOOKS right...
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://907576]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2014-04-20 16:00 GMT
Find Nodes?
    Voting Booth?

    April first is:

    Results (485 votes), past polls