It prints the data to the console and makes a 0kbyte test.txt file, an empty file.
I made double sure the file name in my $a matches by doing a print, and I can see the program is running on the correct file, but it seems that the expression is being evaluated differently, or in a different order.
Any suggestions on how to get it to print to the text file while using the $a string?