use FindBin; use lib "$FindBin::Bin/myLibs"; my $file = "$FindBin::Bin/xyz.txt"; open( my $FH, "<", $myFile ) or die $!;