in reply to Perl Input Parameters for Unix

So all you wish to know is how to parse input parameters. Rest of the code you posted does not matter :)
You can also try parsing them manually using @ARGV.
Something like
if ( $ARGV[0] eq "-i" ) { #do something with $ARGV[1] }