my $filename = 'This_filename_has_2 2_spaces.txt'; my $tempstr = "echo \"$filename\" |"; printf "Below is the output of \'$tempstr\'\n";