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