Command line args are in the perl variable @ARGV, which is in the main package. You can go wading through the symbol tables for it, but it'd probably be easier to pass in a reference to it from your perl code, in case you want to use the routine on an alternate array or something.