in reply to Perl/Tk invoking a batch command and passing argument
And of course you should have
use strict; use warnings; [download]
at the top of your code.