in reply to Calling a shell script after changing directory

As haukex says, system is a bit special in that it returns 0 on success. A common way to handle that is as follows:
system($cmd) and die "command failed with code " . ($? >> 8).

Also, in order to chain several commands into a single shell call it is better to use && instead of the semicolon. That way, if some command fails, processing stops immediately.

$cmd = 'cd /home/folder1/folder2 && sh test1.sh';