Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

How to open file while giving exec permissions?

by ovedpo15 (Pilgrim)
on Feb 06, 2022 at 22:40 UTC ( [id://11141180]=perlquestion: print w/replies, xml ) Need Help??

ovedpo15 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks!
A really simple question here. I'm creating a file and I would like to give it exec permission, same as I get for chmod a+x file. The code:
sub test { my ($file) = @_; open(my $fh, '>>', "$file") or die("failed to open file"); # prints content close($fh); }
From the docs I understand that it sets the permissions to 0666. How can I make it have exec bits?

Replies are listed 'Best First'.
Re: How to open file while giving exec permissions?
by Anonymous Monk on Feb 06, 2022 at 23:07 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11141180]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found