Do you think this can be done like this?
Yes, there are no reasons why this is not possible.
Are there any better solutions?
May be. If you intend to execute the perl shell as a system call of a separate Perl script, you do not need a separate CGI perl script. You can simply make system calls with PHP directly on your site. Not a big difference, but it can help if PHP is more for your comfort zone for web content than Perl CGI
OTOH, Perl script API, Perl CGI, Perl script Perl CGI script API , .
, - Win Win, .