Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: File permissions

by Malkavian (Friar)
on Mar 31, 2001 at 21:32 UTC ( #68677=note: print w/replies, xml ) Need Help??


in reply to File permissions

Just a quick thought on this.
If you have the perms set to 644, you're saying that the script is read/write to user, and read to all others.
From a command line, it's not treated as an executable, so, for instance typing './programname' won't run.
However, if you're specifying an executable to run this script, it will run (as it can be read), thus typing 'perl ./programname' will run.
In essence, you're not really 'executing' the script, you're using it as a text file to be read and interpreted by the executable.

Malk.

Replies are listed 'Best First'.
Re: Re: File permissions
by nysus (Vicar) on Mar 31, 2001 at 21:37 UTC
    Got it. Yeah, I'm running it from the command line: 'perl filename'

    I take it this also means that if I call this script using Perl's 'require' command, the script will work in that situation, too. Great.

      For running an external script it is generally better to use do.

      But better still would be to wrap what the script does in some well-named functions, require the script, and then call the functions as needed. See also package and Exporter for standard ways of doing that and having the functions in the script not unexpectedly conflicting with your own functions...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2020-03-31 02:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (178 votes). Check out past polls.

    Notices?