You can pass path separately and source and destination file names separately. Like following
$Path = "C:\\foo\\tempfolder\\testfolder\\";
$SourceFile = $Path . "data.txt";
$DestinationFile = $Path . "data_extract.txt";
open ($SFILEHANDLE, '<', $SourceFile) or die $!;
open ($DFILEHANDLE, '>', $DestinationFile) or die $!;