in reply to How to use chmod u +x in perl
my $mode = (stat($filename))[2]; my $new_mode = $mode | 0100; chmod $mode, $filename); [download]