in reply to How to use chmod u +x in perl

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.

True laziness is hard work