in reply to Can someone explain how this works?

This line starts a new process. And opens a file handle to the output of that process.

The 2>&1 line means redirect standard handle 2 to standard handle 1. In other words, take all input that would go to STDERR and redirect it to STDOUT. Why is this beneficial? Well, when you open a process this way only the STDOUT output gets to your Perl program through the opened filehandle. If you want error messages as well you need to redirect the STDERR file handle as has been done here.