The output you see is not from the print statement, it is the console output of ls. To get the ls output into a variable, use backticks:
my $ls = `ls`;
my @lsarray = split(/\s+/, $ls);
print "$lsarray[1]\n";
This is because exec does not return, the statements after it are not executed. From perldoc:
The exec function executes a system command and never returns; use
system instead of exec if you want it to return. It fails and returns
false only if the command does not exist and it is executed directly
instead of via your system's command shell
But using system command will not help you as it does not allow output capturing, hence, the backticks. However, using glob functions is better:
my @arr = glob("*");
print $arr[1], "\n";
Also, perl array indices start at 0, not 1. To get file1.pl you should use print "$lsarray[0]\n".
use warnings, perl would warn you that nothing after theexec()would be executed. ("Statement unlikely to be reached at ...")