if(system(mozilla => -remote => 'ping()')) { warn "mozilla not found!"; my $pid = fork; die "Couldn't fork: $!" if not defined $pid; exec { 'mozilla' } 'mozilla' if $pid == 0; } # and changing the command like so: # (obviously, use "new-window" if you prefer that) my $commandShow = q{mozilla -remote "openurl(%s, new-tab)"};