I am using the following code to try to print a variable in a file.
my $filename = "test/test.csv"; open FILE, "<$filename"; my $xml = get "http://someurl.com"; print $xml; print FILE $xml; close FILE;
So print $xml displays the correct result on the screen. But print FILE $xml does nothing.
Why doesn't printing in a file line work? It seems like Perl often has things that just don't work ...
Does the print line need to exist in the file to work?
source share