in reply to Passing arguments from a different directory.

I have a script which needs to read an array from a/bcd/sample/array.list How can I pass this list file as an argument to a function in my perl script?

Pass from where, starting where?

perl foo.pl a/bcd/sample/array.list ...

#!/usr/bin/perl -- # foo.pl use strict; use warnings; use Path::Tiny qw/ path /; Main( @ARGV ); exit( 0 ); sub Main { my( @files ) = @_; for my $file ( @files ){ my $stuff = path( $file )->slurp_raw; ...; } }

Path::Tiny, @ARGV, Writing subroutines...