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

Re: help me with errors in perl module.

by marscld (Beadle)
on Oct 13, 2011 at 08:40 UTC ( [id://931164]=note: print w/replies, xml ) Need Help??


in reply to help me with errors in perl module.

The 1st line would not be necessary.
  • Comment on Re: help me with errors in perl module.

Replies are listed 'Best First'.
Re^2: help me with errors in perl module.
by davido (Cardinal) on Oct 13, 2011 at 14:54 UTC

    It might be helpful to specify which first line.

    To fill in that blank, the first line that isn't necessary is the shbang line (the one that starts with #!/...) at the top of the module's source. It is necessary at the top of the main program's source, however.

    While we're at it, let's give a reason so that in the future it's easier to remember: The operating system needs to know what program to use to interpret the lines of code that follow. One could specify #!/bin/sh for a shell script, for example. But for a Perl script, we want to direct the operating system to our installed Perl interpreter.

    Since it is the main program that is invoked by the user as an executable command, that is where the shebang needs to be located. That's the only point where the operating system wouldn't know what to do, if the #!/... line weren't there. Once the main program is invoked and the Perl interpreter is fired up, perl handles calling and executing the modules. perl already knows where it lives, and doesn't need for the modules to specify a location. Luckily since the line is set up to look like a comment, it's just ignored when it appears at inappropriate places.


    Dave

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2024-04-25 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found