in reply to opening files where name is a concatenation of variable
my $tempname = $basedir . '/output/file.txt';
You might use string interpolation here, like: "${basedir}/output/file.txt";
open (OUTHANDLE, ">$tempname") or die;
Better use indirect filehandle and let it tell yourself *why* it died,
open (OUTHANDLE, ">$basedir . /output/file.txt") or die ;
This might be a typo, but you used string interpolation ("..") *AND*instead. The ${name} thingy would allow interpolation *within* wordsmy $basedir = 'results'; my $tempname = "${basedir}/output/file.txt"; open my $oh1, '>', $tempname or die "$!"; open my $oh2, '>', "${basedir}/output/file.txt" or die "$!";
|
|---|