You need to use qx() or `` (back ticks) to execute a command line from within Perl (there are other ways as well, but lets keep it simple for now):
my $filename = "sample.pdf"; qx(chmod u+x '$filename');
The single quotes around the file name are only needed if you have unquoted spaces or other special characters in the file name, but do no harm.
See Quote and Quote like Operators.
In reply to Re: How to use chmod u +x in perl
by GrandFather
in thread How to use chmod u +x in perl
by fearthechris29
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |