http://www.perlmonks.org?node_id=1012718


in reply to Re: Correct pathway to a file
in thread Correct pathway to a file

Hi blue cowdawg

I tried this within the sub

my $fname = join("/",$_[0]); my $INP = $_[1]; open (FIN, "<$fname") or die "$fname$!"; my @words =<FIN>; chomp @words; close FIN;

because I sent my sub the file+directory like you showed, and also an integer which has to be used later in the sub.

But even the short script you sent earlier only works if I have copies of the text file at the directory where I specify and also where my perl script is stored.