#!/usr/bin/perlX exec '/path/to/perlY', @ARGV if ( -x "/path/to/perlY" ); exec '/usr/bin/perlX', @ARGV;