in reply to How can we read input argument file to a script from its main library?

In the script, read the file name from $ARGV[0] or use a library as others have recommended. Then pass the file name as an argument to the library:
package My::XML; sub parse_xml { my ($filename) = @_; ... }

and call

use My::XML; my $filename = $ARGV[0]; my $data = parse_xml($filename);

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,