in reply to passing vars to a sub

You might have more luck getting help here if you made a copy of this script and tried removing some of the "extra" pieces, so that we're left with the smallest piece of code that still has this problem.

As an aside, in "$print_subsystem" == "cups", you need to replace the == (numeric equality comparison) with eq (string equality).