in reply to Re^2: chmod in perl
in thread chmod in perl

Try and put the semicolon after first die statement. Because of that its throwing that error because it's gonna continue till the end of file if you dont specify where to exactly end.