There's a couple of ways to manage this.
You can make both Q1 and Q2 parent lists the same at Q1 and Q2 for the cars.
Normally something like this would work:
But if you don't have all Q1=1-2 cars being displayed at Q2, you can insert some Remove functions like this:
This will select all Q1=1-2 cars and remove cars 10+20+29+30+31. No Perl script required here. That's the easiest method!
If you need to use a different list at Q2, Perl will be required. If you reply back and post your Perl script, I can see where you are slipping up. Provide all list details too.